diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php index 6775fe99dc..b1aec08890 100644 --- a/lib/private/legacy/helper.php +++ b/lib/private/legacy/helper.php @@ -558,7 +558,8 @@ class OC_Helper { || $storage->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage') ) { /** @var \OC\Files\Storage\Home $storage */ - $user = $storage->getUser(); + $userInstance = $storage->getUser(); + $user = ($userInstance === null) ? null : $userInstance->getUID(); } else { $user = \OC::$server->getUserSession()->getUser()->getUID(); }