]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix npe when createStorage() returns null
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 19 Mar 2013 14:02:29 +0000 (15:02 +0100)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 19 Mar 2013 14:02:29 +0000 (15:02 +0100)
lib/files/mount.php

index 1c9382d78e7d5347b04893217a24c1a4fc4f173b..59c98e9dcc8e651ca8b874408f6bd338a25bac27 100644 (file)
@@ -90,7 +90,11 @@ class Mount {
        public function getStorageId() {
                if (!$this->storageId) {
                        if (is_null($this->storage)) {
-                               $this->storage = $this->createStorage();
+                               $storage = $this->createStorage(); //FIXME: start using exceptions
+                               if (is_null($storage)) {
+                                       return null;
+                               }
+                               $this->storage = $storage;
                        }
                        $this->storageId = $this->storage->getId();
                        if (strlen($this->storageId) > 64) {