Skip to content

Commit

Permalink
fix(core): handle no userId in getUser
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Mar 13, 2024
1 parent 11d15ce commit df5c9f7
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 df5c9f7

Please sign in to comment.