diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-05-24 11:54:09 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-05-24 11:55:44 +0200 |
commit | 66d35a15280795b76a81c3e59cebbd2a29e4dff8 (patch) | |
tree | 6f501d5e4a5599e86f547786f3c3eac8ea73d52e | |
parent | b7105d7b5712dcdbf9dadebfddaba7691810da5c (diff) | |
download | wekan-66d35a15280795b76a81c3e59cebbd2a29e4dff8.tar.gz wekan-66d35a15280795b76a81c3e59cebbd2a29e4dff8.tar.bz2 wekan-66d35a15280795b76a81c3e59cebbd2a29e4dff8.zip |
Fix minicard cover functionality
Otherwise, if `this.coverId` is undefined then `Attachments.findOne()` would
return any attachment.
-rw-r--r-- | models/cards.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js index f4bb464c..757772f3 100644 --- a/models/cards.js +++ b/models/cards.js @@ -535,6 +535,7 @@ Cards.helpers({ }, cover() { + if (!this.coverId) return false; 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? |