Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/news.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2020-03-09 20:26:31 +0300
committerSean Molenaar <SMillerDev@users.noreply.github.com>2020-03-10 01:03:30 +0300
commit95ef23b1438bc1b40df7e28a0dba0176c2506e25 (patch)
tree96fb317f1b6b893e12b169312c1ae68a7b1c8fb0
parentcc051c6ce7d32f34f25b45e815535f168521d9c1 (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.php3
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);