Browse Source

Bug fix - null check

Carsten Porth 5 years ago
parent
commit
cade3c6b38
1 changed files with 4 additions and 2 deletions
  1. 4 2
      dashboard/app.js

+ 4 - 2
dashboard/app.js

@@ -61,7 +61,7 @@ const app = new Vue({
       this.showLoading = true;
 
       if (this.hashtagKey === null) {
-        console.info("No hashtags posted on this day");
+        console.info("No hashtags posted on this day (" + this.date + ")");
       } else {
         let data = await gun
           .get(gunId)
@@ -78,7 +78,9 @@ const app = new Vue({
         for (let i = 0; i < this.total; i++) {
           this.done = i + 1;
           const hashtagEntry = await gun.get(keys[i]).then();
-          this.hashtags.push(hashtagEntry["hashtags"]);
+          if (hashtagEntry !== undefined && hashtagEntry["hashtags"]) {
+            this.hashtags.push(hashtagEntry["hashtags"]);
+          }
         }
       }