From 4900ba729ca2164161aabae88aa50dab66620d94 Mon Sep 17 00:00:00 2001 From: leejinho Date: Tue, 17 Mar 2020 16:30:15 +0900 Subject: [PATCH] bugfix :: clear setting & logout >> setting null exception. --- .../app/services/authentication.service.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts index 644221b3..4f67b21a 100644 --- a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts @@ -118,21 +118,23 @@ export class AppAuthenticationService { environment.customConfig.appKey ); - appUserInfo = { - ...appUserInfo, - settings: { - ...appUserInfo.settings, - general: { - ...appUserInfo.settings.general, - autoLogin: false + if (!!appUserInfo) { + appUserInfo = { + ...appUserInfo, + settings: { + ...appUserInfo.settings, + general: { + ...appUserInfo.settings.general, + autoLogin: false + } } - } - }; + }; - this.localStorageService.encSet( - KEY_APP_USER_INFO, - appUserInfo, - environment.customConfig.appKey - ); + this.localStorageService.encSet( + KEY_APP_USER_INFO, + appUserInfo, + environment.customConfig.appKey + ); + } } }