diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 1bb56e6a37e9d..dfd4854de1f2e 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -438,16 +438,15 @@ public function getWatcher(string $path = '', ?IStorage $storage = null): IWatch // Get node information $node = $this->getShare()->getNodeCacheEntry(); if ($node instanceof CacheEntry) { - $storageId = $node->getData()['storage_string_id']; + $storageId = $node->getData()['storage_string_id'] ?? null; // for shares from the home storage we can rely on the home storage to keep itself up to date // for other storages we need use the proper watcher - if (!(str_starts_with($storageId, 'home::') || str_starts_with($storageId, 'object::user'))) { + if ($storageId !== null && !(str_starts_with($storageId, 'home::') || str_starts_with($storageId, 'object::user'))) { $cache = $this->getCache(); $this->watcher = parent::getWatcher($path, $storage); if ($cache instanceof Cache) { $this->watcher->onUpdate($cache->markRootChanged(...)); } - return $this->watcher; } }