Skip to content

Node.js based forum software built for the modern web

closes #5659

Barış Soner Uşaklı5a9b7b673a06
diff --git a/src/flags.js b/src/flags.js
index 9022af2c45..09d4c6e498 100644
--- a/src/flags.js
+++ b/src/flags.js
@@ -15,7 +15,7 @@ var utils = require('../public/src/utils');
var _ = require('underscore');
var S = require('string');
-var Flags = {};
+var Flags = module.exports;
Flags.get = function (flagId, callback) {
async.waterfall([
@@ -26,6 +26,9 @@ Flags.get = function (flagId, callback) {
notes: async.apply(Flags.getNotes, flagId),
}),
function (data, next) {
+ if (!data.base) {
+ return callback();
+ }
// Second stage
async.parallel({
userObj: async.apply(user.getUserFields, data.base.uid, ['username', 'userslug', 'picture']),