Skip to content

Commit a9a8178

Browse files
committed
fallback user_id
1 parent bb8424e commit a9a8178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frontend_react/src/api/config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function getApiUrl() {
7575
}
7676

7777
export function getUserId(): string {
78-
USER_ID = window.userInfo ? window.userInfo[0].user_id : null;
78+
USER_ID = window.userInfo && window.userInfo[0] && window.userInfo[0].user_id ? window.userInfo[0].user_id : null;
7979
const userId = USER_ID ?? "00000000-0000-0000-0000-000000000000";
8080
return userId;
8181
}

0 commit comments

Comments
 (0)