]> source.dussan.org Git - nextcloud-server.git/commitdiff
handle non existing owners when handling dav requests 3681/head
authorRobin Appelman <robin@icewind.nl>
Thu, 2 Mar 2017 14:26:00 +0000 (15:26 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 2 Mar 2017 14:26:00 +0000 (15:26 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/lib/Connector/Sabre/FilesPlugin.php

index 5e401b88481dbf27ba412b5f2dbaaeecbff2229c..2f86ce5bf4127715ec9aa91e3a5360e267bd7952 100644 (file)
@@ -317,12 +317,19 @@ class FilesPlugin extends ServerPlugin {
 
                        $propFind->handle(self::OWNER_ID_PROPERTYNAME, function() use ($node) {
                                $owner = $node->getOwner();
-                               return $owner->getUID();
+                               if (!$owner) {
+                                       return null;
+                               } else {
+                                       return $owner->getUID();
+                               }
                        });
                        $propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function() use ($node) {
                                $owner = $node->getOwner();
-                               $displayName = $owner->getDisplayName();
-                               return $displayName;
+                               if (!$owner) {
+                                       return null;
+                               } else {
+                                       return $owner->getDisplayName();
+                               }
                        });
 
                        $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {