diff --git a/jam-ui/src/components/client/JKSessionScreen.js b/jam-ui/src/components/client/JKSessionScreen.js index a0ee85e4e..e2e6decde 100644 --- a/jam-ui/src/components/client/JKSessionScreen.js +++ b/jam-ui/src/components/client/JKSessionScreen.js @@ -367,7 +367,9 @@ const JKSessionScreen = () => { } catch (error) { logger.error("User profile is not appropriate for session:", error); - if (!error.controlled_location) { + if (!error?.controlled_location) { + // Handle error without controlled_location + // Session leave will be triggered by outer catch block } } } catch (error) { diff --git a/jam-ui/src/hooks/useSessionModel.js b/jam-ui/src/hooks/useSessionModel.js index 1c1ae4faf..16fd4b6af 100644 --- a/jam-ui/src/hooks/useSessionModel.js +++ b/jam-ui/src/hooks/useSessionModel.js @@ -440,7 +440,7 @@ export default function useSessionModel(app, server, sessionScreen) { // Leave session REST call (from useSessionLeave) const leaveSessionRest = useCallback(async () => { - const clientId = jamClient.GetClientID(); + const clientId = await jamClient.GetClientID(); if (!clientId) return; try {