From 5a9b7b673a06e8e00c23ffef1570760ab6a3c890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 9 May 2017 14:16:21 -0400 Subject: [PATCH] closes #5659 --- src/flags.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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']),