From 5f2236563baf2af1c76ae4807583f14eb395f5d3 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Thu, 11 Jan 2024 19:53:22 -0500 Subject: [PATCH] Fix bug where invalid server Id leads to stack --- app/classes/controllers/servers_controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index 88923194..86e17802 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -462,7 +462,10 @@ class ServersController(metaclass=Singleton): @staticmethod def server_id_exists(server_id): - srv = ServersController().get_server_instance_by_id(server_id) + try: + srv = ServersController().get_server_instance_by_id(server_id) + except ValueError: + return False return srv.stats_helper.server_id_exists() @staticmethod