From 0f53bc5ea0a7553ab1da0fe0d53f2117e6d6344d Mon Sep 17 00:00:00 2001 From: RyanTimin <127608377+RyanTimin@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:48:54 +0200 Subject: [PATCH] fix: do not close sidenave when undefined The sidenave is only available in the reduced version of the nav bar. When loading the page without the sidenav child, an error occurs : "shell.component.ts:27 ERROR TypeError: Cannot read properties of undefined (reading 'close')". --- .../src/app/shell/__material-simple.shell.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/app/templates/src/app/shell/__material-simple.shell.component.ts b/generators/app/templates/src/app/shell/__material-simple.shell.component.ts index aeee5ff4..b3acfbb0 100644 --- a/generators/app/templates/src/app/shell/__material-simple.shell.component.ts +++ b/generators/app/templates/src/app/shell/__material-simple.shell.component.ts @@ -25,7 +25,7 @@ export class ShellComponent implements OnInit { filter(({ matches }) => !matches), untilDestroyed(this) ) - .subscribe(() => this.sidenav.close()); + .subscribe(() => this.sidenav?.close()); } }