From: Marcin Haba Date: Sun, 28 Apr 2019 12:53:38 +0000 (+0200) Subject: baculum: Fix showing validation error if new config is incorrect X-Git-Tag: Release-9.4.3~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef3157abd91d381613f8d220a71e99abd154c446;p=thirdparty%2Fbacula.git baculum: Fix showing validation error if new config is incorrect --- diff --git a/gui/baculum/protected/API/Pages/API/Config.php b/gui/baculum/protected/API/Pages/API/Config.php index 1cec6dfa0..31f7a6622 100644 --- a/gui/baculum/protected/API/Pages/API/Config.php +++ b/gui/baculum/protected/API/Pages/API/Config.php @@ -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;