diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php index 48b7d037c5..dd4f13f7d7 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(); }