diff options
Diffstat (limited to '')
-rw-r--r-- | lib/models/user.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/models/user.js b/lib/models/user.js index 4c823355..62ed5cc7 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -66,6 +66,9 @@ module.exports = function (sequelize, DataTypes) { }) }, getProfile: function (user) { + if (!user) { + return null + } return user.profile ? User.parseProfile(user.profile) : (user.email ? User.parseProfileByEmail(user.email) : null) }, parseProfile: function (profile) { |