From b0ec990ce6c0c6c802760c2e93859dfc72ddde50 Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Mon, 30 Nov 2020 22:55:11 +0800 Subject: [PATCH] Fix null pointer exception for auth guard Signed-off-by: AllForNothing --- src/portal/src/app/shared/route/auth-user-activate.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portal/src/app/shared/route/auth-user-activate.service.ts b/src/portal/src/app/shared/route/auth-user-activate.service.ts index 8e324b4a4..291a49cf4 100644 --- a/src/portal/src/app/shared/route/auth-user-activate.service.ts +++ b/src/portal/src/app/shared/route/auth-user-activate.service.ts @@ -49,7 +49,7 @@ export class AuthCheckGuard implements CanActivate, CanActivateChild { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean { // When routing change, clear this.msgHandler.clear(); - if (this.appConfigService.getConfig().read_only.toString() === 'true') { + if (this.appConfigService.getConfig().read_only && this.appConfigService.getConfig().read_only.toString() === 'true') { this.msgHandler.handleReadOnly(); }