From 93a56242945b8c636313b6975ffce379ea99c27c Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Wed, 17 Sep 2025 11:50:36 +0800 Subject: [PATCH] Update dashboard.py Fix for #892 --- src/dashboard.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index fde8c53b..30c4c7a8 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -856,15 +856,21 @@ def API_addPeers(configName): preshared_key: str = data.get('preshared_key', "") if type(mtu) is not int or mtu < 0 or mtu > 1460: - default: str = DashboardConfig.GetConfig("Peers", "peer_MTU")[1] + default: str = DashboardConfig.GetConfig("Peers", "peer_mtu")[1] if default.isnumeric(): - mtu = default + try: + mtu = int(default) + except Exception as e: + mtu = 0 else: mtu = 0 if type(keep_alive) is not int or keep_alive < 0: default = DashboardConfig.GetConfig("Peers", "peer_keep_alive")[1] if default.isnumeric(): - keep_alive = default + try: + keep_alive = int(default) + except Exception as e: + keep_alive = 0 else: keep_alive = 0