diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-03-09 20:26:31 +0300 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2020-03-10 01:03:30 +0300 |
commit | 95ef23b1438bc1b40df7e28a0dba0176c2506e25 (patch) | |
tree | 96fb317f1b6b893e12b169312c1ae68a7b1c8fb0 | |
parent | cc051c6ce7d32f34f25b45e815535f168521d9c1 (diff) |
Check if $feed is null
and we are unable to continue because there is no valid feed data
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
-rw-r--r-- | lib/Service/FeedService.php | 3 |
1 files changed, 3 insertions, 0 deletions
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); |