summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/frontenddefinitiontrait.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/frontenddefinitiontrait.php')
-rw-r--r--apps/files_external/lib/frontenddefinitiontrait.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_external/lib/frontenddefinitiontrait.php b/apps/files_external/lib/frontenddefinitiontrait.php
index eedd433f2d7..fc47a9515f3 100644
--- a/apps/files_external/lib/frontenddefinitiontrait.php
+++ b/apps/files_external/lib/frontenddefinitiontrait.php
@@ -136,10 +136,12 @@ trait FrontendDefinitionTrait {
public function validateStorageDefinition(StorageConfig $storage) {
foreach ($this->getParameters() as $name => $parameter) {
$value = $storage->getBackendOption($name);
- if (!$parameter->validateValue($value)) {
- return false;
+ if (!is_null($value) || !$parameter->isOptional()) {
+ if (!$parameter->validateValue($value)) {
+ return false;
+ }
+ $storage->setBackendOption($name, $value);
}
- $storage->setBackendOption($name, $value);
}
return true;
}