Skip to content

Commit

Permalink
fix(project): handle missing current route information
Browse files Browse the repository at this point in the history
  • Loading branch information
luytena committed Mar 18, 2024
1 parent d08fd30 commit 8eabd5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addon/controllers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class ProjectController extends Controller {
@service constructionProject;

get activeProjectId() {
return Number(this.router.externalRouter.currentRoute.params.project_id);
return Number(this.router.externalRouter.currentRoute?.params.project_id);
}

get isLoading() {
Expand All @@ -20,8 +20,8 @@ export default class ProjectController extends Controller {
get displayLandingPage() {
return (
!this.projects.value?.length &&
this.router.externalRouter.currentRoute.localName !== "new" &&
this.router.externalRouter.currentRoute.localName !== "errors"
this.router.externalRouter.currentRoute?.localName !== "new" &&
this.router.externalRouter.currentRoute?.localName !== "errors"
);
}

Expand Down

0 comments on commit 8eabd5f

Please sign in to comment.