From f44d1fc85d638409fb1534a3f7ff260a1ee4671e Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 30 Dec 2021 11:44:19 -0100 Subject: [PATCH] exception on null token Signed-off-by: Maxence Lange --- lib/ShareByCircleProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ShareByCircleProvider.php b/lib/ShareByCircleProvider.php index a8d1f3a4d..81d8f5e14 100644 --- a/lib/ShareByCircleProvider.php +++ b/lib/ShareByCircleProvider.php @@ -585,6 +585,10 @@ function (ShareWrapper $wrapper) { * @throws ShareNotFound */ public function getShareByToken($token): IShare { + if (is_null($token)) { + throw new ShareNotFound(); + } + try { $wrappedShare = $this->shareWrapperService->getShareByToken($token); } catch (ShareWrapperNotFoundException $e) {