No username implies no aliases

This commit is contained in:
Girish Ramakrishnan
2017-02-02 01:22:44 -08:00
parent 7812c0e5c2
commit bd0be2affc

View File

@@ -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));