gateways: null is not going to be a UUID either

ErrorException: Using null as an array offset is deprecated, use an empty string instead in /usr/local/opnsense/mvc/app/controllers/OPNsense/Routing/Api/SettingsController.php:162
Stack trace:
This commit is contained in:
Stephan de Wit
2026-10-06 15:11:16 +02:00
parent dfc07590e9
commit d7cc8e1c0f
@@ -157,7 +157,7 @@ class SettingsController extends ApiMutableModelControllerBase
public function getGatewayAction($uuid = null)
{
if (!Type::isUUID($uuid)) {
if (!empty($uuid) && !Type::isUUID($uuid)) {
/* uuid is likely a gateway name (legacy config) */
$gateway = $this->getModel()->gatewaysIndexedByName(true, false, true)[$uuid] ?? [];
if (!empty($gateway)) {