Skip to content

Commit

Permalink
fix(core): handle no userId in getUser (#5992)
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner authored Mar 14, 2024
1 parent 1d2775c commit c9ceac0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/sanity/src/core/store/_legacy/user/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export function createUserStore({client: _client, currentUser}: UserStoreOptions

return {
getUser: async (userId) => {
if (!userId) return Promise.resolve(null)

try {
return await userLoader.load(userId)
} catch (err) {
Expand Down

0 comments on commit c9ceac0

Please sign in to comment.