Merge pull request #3681 from nextcloud/dav-nonexisting-owner

handle non existing owners when handling dav requests
This commit is contained in:
Morris Jobke 2017-03-02 21:55:51 -06:00 committed by GitHub
commit 8e9b119c5f
1 changed files with 10 additions and 3 deletions

View File

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