]> source.dussan.org Git - nextcloud-server.git/commitdiff
handle case where fileid is not set
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 23 Oct 2013 14:40:29 +0000 (16:40 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 23 Oct 2013 14:40:29 +0000 (16:40 +0200)
lib/private/connector/sabre/filesplugin.php
lib/private/connector/sabre/node.php

index c9d43a038dbedd92ea0e03bfeafb5ac532a02741..46ca14fadcdbf55ea9755b36ae9a75fc11034681 100644 (file)
@@ -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;
+                       }
 
                }
 
index 5c0fd2dcadc28855e95c7c537bb643e7efc493aa..76fbc251100d18543ed77dbc8fbee8ce74423f74 100644 (file)
@@ -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;
        }
 }