Browse Source

add check to exist

yusuketk 6 years ago
parent
commit
ed892d0b8b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/client/js/services/AppContainer.js

+ 4 - 0
src/client/js/services/AppContainer.js

@@ -280,6 +280,10 @@ export default class AppContainer extends Container {
   }
   }
 
 
   removeOldUserCache() {
   removeOldUserCache() {
+    if (window.localStorage.userByName == null) {
+      return;
+    }
+
     const keys = ['userByName', 'userById', 'users', 'lastFetched'];
     const keys = ['userByName', 'userById', 'users', 'lastFetched'];
 
 
     keys.forEach((key) => {
     keys.forEach((key) => {