From 2521efa34db3a01eab9c6ec3c2ab0e6ed2851f74 Mon Sep 17 00:00:00 2001 From: Jonathan Flueren Date: Tue, 3 May 2022 22:27:55 +0200 Subject: [PATCH] Don't crash on unauthenticated api call --- CHANGELOG.md | 3 +++ lib/Controller/EpisodeActionController.php | 2 +- lib/Controller/SubscriptionChangeController.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e00cab2..a0c3ce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## 3.3.0 - 2022-05-03 +### Fixed +- Don't crash on unauthenticated api call +### Changed - Add support for Nextcloud 24 ## 3.2.0 - 2021-12-09 diff --git a/lib/Controller/EpisodeActionController.php b/lib/Controller/EpisodeActionController.php index 2013324..f0cef9a 100644 --- a/lib/Controller/EpisodeActionController.php +++ b/lib/Controller/EpisodeActionController.php @@ -26,7 +26,7 @@ class EpisodeActionController extends Controller { ) { parent::__construct($AppName, $request); $this->episodeActionRepository = $episodeActionRepository; - $this->userId = $UserId; + $this->userId = $UserId !== null ? $UserId : ''; $this->episodeActionSaver = $episodeActionSaver; $this->request = $request; } diff --git a/lib/Controller/SubscriptionChangeController.php b/lib/Controller/SubscriptionChangeController.php index 1d533c4..d7c1cbd 100644 --- a/lib/Controller/SubscriptionChangeController.php +++ b/lib/Controller/SubscriptionChangeController.php @@ -28,7 +28,7 @@ class SubscriptionChangeController extends Controller { parent::__construct($AppName, $request); $this->subscriptionChangeSaver = $subscriptionChangeSaver; $this->subscriptionChangeRepository = $subscriptionChangeRepository; - $this->userId = $UserId; + $this->userId = $UserId !== null ? $UserId : ''; } /**