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