Merge pull request #50769 from nextcloud/checkStorageIdSetCache

fix(SharedStorage): Check if storage ID is set on cache
pull/50823/head
Christoph Wurst 2025-02-14 14:17:00 +07:00 committed by GitHub
commit 228ac86fa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

@ -438,16 +438,15 @@ class SharedStorage extends Jail implements LegacyISharedStorage, ISharedStorage
// 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;
}
}