From e87312e1da26816776db400c52f6478e4af535cc Mon Sep 17 00:00:00 2001 From: kicap Date: Sat, 27 Jul 2024 21:07:13 +0700 Subject: [PATCH] repair app.py --- structures/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/structures/app.py b/structures/app.py index fcbd59f..29697cb 100644 --- a/structures/app.py +++ b/structures/app.py @@ -146,7 +146,8 @@ class App: def get_host(self): ips = gethostbyname_ex(gethostname())[2] - for ip in ips: - if ip.split(".")[2] == "1": - return ip - return ips[1] + if len(ips) > 1: + for ip in ips: + if ip.split(".")[2] == "1": + return ip + return ips[0]