From 66d35a15280795b76a81c3e59cebbd2a29e4dff8 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sun, 24 May 2020 11:54:09 +0200 Subject: Fix minicard cover functionality Otherwise, if `this.coverId` is undefined then `Attachments.findOne()` would return any attachment. --- models/cards.js | 1 + 1 file changed, 1 insertion(+) (limited to 'models') 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? -- cgit v1.2.3-1-g7c22