handle case where fileid is not set
This commit is contained in:
parent
b60ae11db8
commit
b02a485712
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue