From 57efe319597c80a41e3c32b1bed252e5f3a777f1 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 19 Dec 2022 00:42:48 +0100 Subject: [PATCH] Return empty list if hostname lookup fails --- ui/server.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/server.py b/ui/server.py index 2db312de..d69b03fb 100644 --- a/ui/server.py +++ b/ui/server.py @@ -314,9 +314,15 @@ def getUIPlugins(): return plugins def getIPConfig(): - ips = socket.gethostbyname_ex(socket.gethostname()) - ips[2].append(ips[0]) - return ips[2] + try: + ips = socket.gethostbyname_ex(socket.gethostname()) + ips[2].append(ips[0]) + return ips[2] + except Exception as e: + print(e) + print(traceback.format_exc()) + return [] + @app.get('/get/{key:path}') def read_web_data(key:str=None):