summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/cards.js b/models/cards.js
index 2e16583d..1895fc69 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -108,7 +108,10 @@ Cards.helpers({
},
cover() {
- return 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
+ // todo XXX we could return a default "upload pending" image in the meantime?
+ return cover && cover.url() && cover;
},
absoluteUrl() {