Forráskód Böngészése

Fix minicard cover functionality

Otherwise, if `this.coverId` is undefined then `Attachments.findOne()` would
return any attachment.
Marc Hartmayer 5 éve
szülő
commit
66d35a1528
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      models/cards.js

+ 1 - 0
models/cards.js

@@ -535,6 +535,7 @@ Cards.helpers({
   },
   },
 
 
   cover() {
   cover() {
+    if (!this.coverId) return false;
     const cover = Attachments.findOne(this.coverId);
     const cover = Attachments.findOne(this.coverId);
     // if we return a cover before it is fully stored, we will get errors when we try to display it
     // if we return a cover before it is fully stored, we will get errors when we try to display it
     // todo XXX we could return a default "upload pending" image in the meantime?
     // todo XXX we could return a default "upload pending" image in the meantime?