diff --git a/src/stores/instance.js b/src/stores/instance.js index 46d5a6ca..d4082b0a 100644 --- a/src/stores/instance.js +++ b/src/stores/instance.js @@ -540,7 +540,7 @@ export const useInstanceStore = defineStore('Instance', () => { }; } } - const { instanceId, shortName } = D.$location; + const { instanceId, shortName } = D?.$location || {}; if (instanceId && typeof instances[instanceId] === 'undefined') { instances[instanceId] = { id: instanceId, @@ -555,7 +555,7 @@ export const useInstanceStore = defineStore('Instance', () => { const cachedCurrentUser = userStore.cachedUsers.get( userStore.currentUser.id ); - const lastLocation$ = cachedCurrentUser.$location; + const lastLocation$ = cachedCurrentUser?.$location; const playersInInstance = locationStore.lastLocation.playerList; if (lastLocation$.worldId === D.id && playersInInstance.size > 0) { // pull instance json from cache