From fbf176d5d8a3ee57e47721f7f630ec2de7cfe941 Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Tue, 25 Feb 2025 10:24:34 -0500 Subject: [PATCH] coderabbit - error handling --- emhttp/plugins/dynamix.docker.manager/include/Events.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emhttp/plugins/dynamix.docker.manager/include/Events.php b/emhttp/plugins/dynamix.docker.manager/include/Events.php index 2b117e8ca..841d87e9c 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/Events.php +++ b/emhttp/plugins/dynamix.docker.manager/include/Events.php @@ -33,6 +33,10 @@ case 'start': if ($container) { $info = $DockerClient->getDockerContainers(); $key = array_search($container,array_column($info,"Id")); + if ( $key === false ) { + $arrResponse = ['success' => _('Container not found. Try reloading this page to fix.')]; + break; + } if ($info[$key]['NetworkMode'] == "host" && $info[$key]['Cmd'] == "/opt/unraid/tailscale") { $arrResponse = ['success'=> _('For security reasons, containers with Network Type "Host" should not have Tailscale enabled. Please disable Tailscale in this container or change the Network Type of the container.')]; break;