]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix showing validation error if new config is incorrect
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 28 Apr 2019 12:53:38 +0000 (14:53 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 28 Apr 2019 14:58:31 +0000 (16:58 +0200)
gui/baculum/protected/API/Pages/API/Config.php

index 1cec6dfa0c77ebe010fd7c406f0d97d43c941ef3..31f7a662222075fc864c4d29c2559fbbcbd6a386 100644 (file)
@@ -45,6 +45,11 @@ class Config extends BaculumAPIServer {
                } else {
                        $config = array();
                }
+               if (is_null($config)) {
+                       $this->output = BaculaConfigError::MSG_ERROR_CONFIG_VALIDATION_ERROR;
+                       $this->error = BaculaConfigError::ERROR_CONFIG_VALIDATION_ERROR;
+                       return;
+               }
                $component_type = $this->Request->contains('component_type') ? $this->Request['component_type'] : null;
                $resource_type = $this->Request->contains('resource_type') ? $this->Request['resource_type'] : null;
                $resource_name = $this->Request->contains('resource_name') ? $this->Request['resource_name'] : null;