dont return an owner for files that don't exist

This commit is contained in:
Robin Appelman 2015-12-10 14:05:27 +01:00 committed by Thomas Müller
parent 05f9b40419
commit fd2e1086c6
1 changed files with 7 additions and 2 deletions

View File

@ -1573,10 +1573,15 @@ class View {
* Get the owner for a file or folder
*
* @param string $path
* @return string
* @return string the user id of the owner
* @throws NotFoundException
*/
public function getOwner($path) {
return $this->basicOperation('getOwner', $path);
$info = $this->getFileInfo($path);
if (!$info) {
throw new NotFoundException($path . 'not found while trying to get owner');
}
return $info->getOwner()->getUID();
}
/**