diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index c173cde2d2fb2..2c37a34300e5b 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1685,6 +1685,11 @@ public function getOwner($path) { if (!$info) { throw new NotFoundException($path . ' not found while trying to get owner'); } + + if ($info->getOwner() === null) { + throw new NotFoundException($path . ' has no owner'); + } + return $info->getOwner()->getUID(); }