From 88fed6f95a0ccde9130c47378c863aa5b57570d1 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Wed, 11 May 2016 18:48:59 +0200 Subject: [PATCH] subscribers: fix adding subscriber from admin if collection is empty --- core/server/models/subscriber.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/server/models/subscriber.js b/core/server/models/subscriber.js index eccb7648de..cd8937373c 100644 --- a/core/server/models/subscriber.js +++ b/core/server/models/subscriber.js @@ -88,6 +88,12 @@ Subscriber = ghostBookshelf.Model.extend({ if (subscriberWithEmail) { return subscriberWithEmail; } + }).catch(function (error) { + if (error.message === 'NotFound' || error.message === 'EmptyResponse') { + return Promise.resolve(); + } + + return Promise.reject(error); }); } });