From 870733f03a90d416707d02a11371f9c5ee12503f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 11 Apr 2024 12:38:29 +0100 Subject: [PATCH] fix: Avoid throwing when a workspace file cannot be found due to a failed storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/WorkspaceService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index b23dd468012..988b04fc6c9 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -6,6 +6,7 @@ use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\NotFoundException; +use OCP\Files\StorageInvalidException; use OCP\IL10N; class WorkspaceService { @@ -29,7 +30,8 @@ public function getFile(Folder $folder): ?File { if ($file instanceof File) { return $file; } - } catch (NotFoundException $e) { + } catch (NotFoundException|StorageInvalidException) { + return null; } } }