Browse Source

fix(dashlist): avoid null ref errors

bergquist 9 năm trước cách đây
mục cha
commit
c6768a93c8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      public/app/features/dashboard/impression_store.ts

+ 2 - 2
public/app/features/dashboard/impression_store.ts

@@ -31,8 +31,8 @@ export class ImpressionsStore {
   }
 
   getDashboardOpened() {
-    var k = store.get("dashboard_impressions");
-    return JSON.parse(k);
+    var impressions = store.get("dashboard_impressions");
+    return JSON.parse(impressions || "[]");
   }
 }