From bd0be2affc5ba40c28c3c1834880deda4d3f2729 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 2 Feb 2017 01:22:44 -0800 Subject: [PATCH] No username implies no aliases --- src/user.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/user.js b/src/user.js index 6a79b02fc..a836eb011 100644 --- a/src/user.js +++ b/src/user.js @@ -657,6 +657,8 @@ function getAliases(userId, callback) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND)); if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error)); + if (!user.username) return callback(null, [ ]); + mailboxdb.getAliasesForName(user.username, function (error, aliases) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND)); if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));