From 95ef23b1438bc1b40df7e28a0dba0176c2506e25 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 9 Mar 2020 18:26:31 +0100 Subject: Check if $feed is null and we are unable to continue because there is no valid feed data Signed-off-by: Daniel Kesselberg --- lib/Service/FeedService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Service/FeedService.php b/lib/Service/FeedService.php index de545b9e3..aff9626d8 100644 --- a/lib/Service/FeedService.php +++ b/lib/Service/FeedService.php @@ -115,6 +115,9 @@ class FeedService extends Service */ list($feed, $items) = $this->feedFetcher->fetch($feedUrl, true, null, false, $user, $password); // try again if feed exists depending on the reported link + if ($feed === null) { + throw new ServiceNotFoundException($this->l10n->t('Can not add feed: Unable to parse feed')); + } try { $hash = $feed->getUrlHash(); $this->feedMapper->findByUrlHash($hash, $userId); -- cgit v1.2.3