diff --git a/app/lib/server/functions/getFullUserData.js b/app/lib/server/functions/getFullUserData.js index 63c17bb7d77d..1a33ac474316 100644 --- a/app/lib/server/functions/getFullUserData.js +++ b/app/lib/server/functions/getFullUserData.js @@ -89,6 +89,10 @@ export function getFullUserDataByIdOrUsername({ userId, filterId, filterUsername fields, }; const user = Users.findOneByIdOrUsername(filterId || filterUsername, options); + if (!user) { + return null; + } + user.canViewAllInfo = canViewAllInfo; return myself ? user : removePasswordInfo(user);