diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 16:40:29 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 16:40:29 +0200 |
commit | b02a4857126337688e8ad40d5f74929d005037ac (patch) | |
tree | 1977e31bbce8fbaa55d3892c61760d03fa403d13 /lib | |
parent | b60ae11db8b49aa2a06116625de07fa03349a8e3 (diff) | |
download | nextcloud-server-b02a4857126337688e8ad40d5f74929d005037ac.tar.gz nextcloud-server-b02a4857126337688e8ad40d5f74929d005037ac.zip |
handle case where fileid is not set
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/connector/sabre/filesplugin.php | 5 | ||||
-rw-r--r-- | lib/private/connector/sabre/node.php | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php index c9d43a038db..46ca14fadcd 100644 --- a/lib/private/connector/sabre/filesplugin.php +++ b/lib/private/connector/sabre/filesplugin.php @@ -59,7 +59,10 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin unset($requestedProperties[array_search($fileid_propertyname, $requestedProperties)]); /** @var $node OC_Connector_Sabre_Node */ - $returnedProperties[200][$fileid_propertyname] = $node->getFileId(); + $fileId = $node->getFileId(); + if (!is_null($fileId)) { + $returnedProperties[200][$fileid_propertyname] = $fileId; + } } diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 5c0fd2dcadc..76fbc251100 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -272,8 +272,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr public function getFileId() { $this->getFileinfoCache(); - $instanceId = OC_Util::getInstanceId(); - $id = sprintf('%08d', $this->fileinfo_cache['fileid']); - return $instanceId . $id; + + if (isset($this->fileinfo_cache['fileid'])) { + $instanceId = OC_Util::getInstanceId(); + $id = sprintf('%08d', $this->fileinfo_cache['fileid']); + return $instanceId . $id; + } + + return null; } } |