Merge pull request #13643 from AllForNothing/quick-fixing

Fix null pointer exception for auth guard
This commit is contained in:
Will Sun 2020-12-01 13:34:05 +08:00 committed by GitHub
commit fe2ecf42ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ export class AuthCheckGuard implements CanActivate, CanActivateChild {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | 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();
}