mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #50769 from nextcloud/checkStorageIdSetCache
fix(SharedStorage): Check if storage ID is set on cache
This commit is contained in:
commit
228ac86fa2
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue