From 90ff4641e778f9825047194872bc2dca3344e7b8 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Fri, 20 Nov 2015 15:23:09 +0100
Subject: [PATCH] dont die if the external storage backend doesn't exist

---
 .../service/storagesservice.php               | 31 ++++++++++++-------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/apps/files_external/service/storagesservice.php b/apps/files_external/service/storagesservice.php
index 41bb0ca9b8..3446ed0dab 100644
--- a/apps/files_external/service/storagesservice.php
+++ b/apps/files_external/service/storagesservice.php
@@ -221,17 +221,26 @@ abstract class StoragesService {
 						$currentStorage->setMountPoint($relativeMountPath);
 					}
 
-					$this->populateStorageConfigWithLegacyOptions(
-						$currentStorage,
-						$mountType,
-						$applicable,
-						$storageOptions
-					);
-
-					if ($hasId) {
-						$storages[$configId] = $currentStorage;
-					} else {
-						$storagesWithConfigHash[$configId] = $currentStorage;
+					try {
+						$this->populateStorageConfigWithLegacyOptions(
+								$currentStorage,
+								$mountType,
+								$applicable,
+								$storageOptions
+						);
+
+						if ($hasId) {
+							$storages[$configId] = $currentStorage;
+						} else {
+							$storagesWithConfigHash[$configId] = $currentStorage;
+						}
+					} catch (\UnexpectedValueException $e) {
+						// dont die if a storage backend doesn't exist
+						\OCP\Util::writeLog(
+								'files_external',
+								'Could not load storage: "' . $e->getMessage() . '"',
+								\OCP\Util::ERROR
+						);
 					}
 				}
 			}
-- 
GitLab