Skip to content

Commit

Permalink
[backend] Change error to null if find user return nothing (#6807)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-julien committed Apr 25, 2024
1 parent 0a2d26a commit f8d5e84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/src/domain/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const findById = async (context, user, userId) => {
return INTERNAL_USERS[userId];
}
const data = await resolveUserByIdFromCache(context, userId);
if (!data) throw FunctionalError('User not found', { id: userId });
if (!data) return undefined;
data.password = '*** Redacted ***';
return data;
};
Expand Down

0 comments on commit f8d5e84

Please sign in to comment.