diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/SettingsController.php b/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/SettingsController.php index 91367e92f..1b36c80b6 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/SettingsController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/SettingsController.php @@ -64,7 +64,7 @@ class SettingsController extends ApiMutableModelControllerBase $fn = preg_replace('/Dot/', 'Forward', $method); if (method_exists(get_class($this), $fn)) { // set the type to forward if the request came from the corresponding gui page or is explicitly set in the API call - if (preg_match("/forward/i", $this->request->getHTTPReferer()) || $this->request->getPost('dot')['type'] == 'forward') { + if (preg_match("/forward/i", $this->request->getHTTPReferer()) || ($this->request->getPost('dot') && $this->request->getPost('dot')['type'] == 'forward')) { $this->type = "forward"; } return $this->$fn(...$args);