Skip to content

Commit c9ceac0

Browse files
authoredMar 14, 2024
fix(core): handle no userId in getUser (#5992)
1 parent 1d2775c commit c9ceac0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎packages/sanity/src/core/store/_legacy/user/userStore.ts

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export function createUserStore({client: _client, currentUser}: UserStoreOptions
7474

7575
return {
7676
getUser: async (userId) => {
77+
if (!userId) return Promise.resolve(null)
78+
7779
try {
7880
return await userLoader.load(userId)
7981
} catch (err) {

0 commit comments

Comments
 (0)