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