From 5685d68bd3cdc3205b72a8c0c60be2417bf2b934 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 28 Jun 2023 15:48:55 +0200 Subject: add more checks to ensure mounts aren't empty Signed-off-by: Robin Appelman --- apps/files_sharing/lib/External/Manager.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files_sharing/lib/External') diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index d2e113c8bb3..63c2c19d25b 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -606,6 +606,10 @@ class Manager { $this->logger->error('Mount point to remove share not found', ['mountPoint' => $mountPoint]); return false; } + if (!$mountPointObj instanceof Mount) { + $this->logger->error('Mount point to remove share is not an external share, share probably doesn\'t exist', ['mountPoint' => $mountPoint]); + return false; + } $id = $mountPointObj->getStorage()->getCache()->getId(''); $mountPoint = $this->stripPath($mountPoint); -- cgit v1.2.3