]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix psalm issues
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Nov 2022 16:13:45 +0000 (17:13 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 22 Nov 2022 12:56:17 +0000 (13:56 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/dav/lib/Connector/Sabre/QuotaPlugin.php

index 0e5ffe517283ea5af4f340ac84c2379c7bd6f918..dccd10d6021dbc501b0c41890cee4cfc5d058050 100644 (file)
@@ -150,9 +150,15 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
                // get target node for proper path conversion
                if ($this->server->tree->nodeExists($destinationPath)) {
                        $destinationNode = $this->server->tree->getNodeForPath($destinationPath);
+                       if (!$destinationNode instanceof Node) {
+                               return false;
+                       }
                        $path = $destinationNode->getPath();
                } else {
                        $parentNode = $this->server->tree->getNodeForPath(dirname($destinationPath));
+                       if (!$parentNode instanceof Node) {
+                               return false;
+                       }
                        $path = $parentNode->getPath();
                }