aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-03-20 14:09:58 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-20 14:26:01 +0100
commitd5fa2ec7c3dc194d2e4f8684b781252e76ad43e0 (patch)
tree5a8d841e7cbbd3b3c2d7eab66cc12aa0c00c13c2 /lib/private
parentc451829579de14fbae33b9f59075a025471066c6 (diff)
downloadnextcloud-server-d5fa2ec7c3dc194d2e4f8684b781252e76ad43e0.tar.gz
nextcloud-server-d5fa2ec7c3dc194d2e4f8684b781252e76ad43e0.zip
fix: log error when default getWrapperStorage would return null
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Storage/Wrapper/Wrapper.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php
index 665914df2a7..2c50bbdb11f 100644
--- a/lib/private/Files/Storage/Wrapper/Wrapper.php
+++ b/lib/private/Files/Storage/Wrapper/Wrapper.php
@@ -31,11 +31,14 @@
*/
namespace OC\Files\Storage\Wrapper;
+use OC\Files\Storage\FailedStorage;
use OCP\Files\InvalidPathException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Files\Storage\IWriteStreamStorage;
use OCP\Lock\ILockingProvider;
+use OCP\Server;
+use Psr\Log\LoggerInterface;
class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStreamStorage {
/**
@@ -60,6 +63,12 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
* @return \OC\Files\Storage\Storage
*/
public function getWrapperStorage() {
+ if (!$this->storage) {
+ $message = "storage wrapper " . get_class($this) . " doesn't have a wrapped storage set";
+ $logger = Server::get(LoggerInterface::class);
+ $logger->error($message);
+ $this->storage = new FailedStorage(['exception' => new \Exception($message)]);
+ }
return $this->storage;
}