diff --git a/ui/core/app/routes/application.js b/ui/core/app/routes/application.js index 387c8fef2..e54bbd206 100644 --- a/ui/core/app/routes/application.js +++ b/ui/core/app/routes/application.js @@ -6,6 +6,7 @@ import { inject as service } from '@ember/service'; import { action } from '@ember/object'; import { later } from '@ember/runloop'; import loading from 'ember-loading/decorator'; +import { A } from '@ember/array'; /** * Entry route for the application. @@ -81,7 +82,7 @@ export default class ApplicationRoute extends Route.extend( */ @action error(e) { - const isUnauthenticated = e?.errors[0]?.isUnauthenticated; + const isUnauthenticated = A(e?.errors)?.firstObject?.isUnauthenticated; if (isUnauthenticated) { this.session.invalidate(); return false; diff --git a/ui/core/app/routes/scopes/scope/projects/project/sessions.js b/ui/core/app/routes/scopes/scope/projects/project/sessions.js index 63b53d7db..c5f7c8004 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/sessions.js +++ b/ui/core/app/routes/scopes/scope/projects/project/sessions.js @@ -45,8 +45,12 @@ export default class ScopesScopeProjectsProjectSessionsRoute extends Route { return all( sessions.map(session => hash({ session, - user: this.store.findRecord('user', session.user_id), - target: this.store.findRecord('target', session.target_id), + user: session.user_id + ? this.store.findRecord('user', session.user_id) + : null, + target: session.target_id + ? this.store.findRecord('target', session.target_id) + : null, })) ); }