From 0e3b664647c7b15a3b169e543b2e84b737df85ba Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Fri, 5 Aug 2022 12:36:27 +0200 Subject: Execute feed check after the final url is found Signed-off-by: Benjamin Brahmer --- lib/Service/FeedServiceV2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Service/FeedServiceV2.php b/lib/Service/FeedServiceV2.php index 4dddc9408..3e02b3971 100644 --- a/lib/Service/FeedServiceV2.php +++ b/lib/Service/FeedServiceV2.php @@ -192,10 +192,6 @@ class FeedServiceV2 extends Service ?string $password = null, bool $full_discover = true ): Entity { - if ($this->existsForUser($userId, $feedUrl)) { - throw new ServiceConflictException('Feed with this URL exists'); - } - try { /** * @var Feed $feed @@ -219,6 +215,10 @@ class FeedServiceV2 extends Service } } + if ($this->existsForUser($userId, $feedUrl)) { + throw new ServiceConflictException('Feed with this URL exists'); + } + if ($feed === null) { throw new ServiceNotFoundException('Failed to fetch feed'); } -- cgit v1.2.3