From 40a53c6795e54e199b3429b22d462e69b36305e0 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 20 Aug 2020 18:31:12 +0200 Subject: [PATCH] Added error checking for net_download and net_upload config values --- bpytop.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bpytop.py b/bpytop.py index e31411c..d000f3a 100755 --- a/bpytop.py +++ b/bpytop.py @@ -449,6 +449,9 @@ class Config: if isinstance(new_config["update_ms"], int) and new_config["update_ms"] < 100: new_config["update_ms"] = 100 self.warnings.append(f'Config key "update_ms" can\'t be lower than 100!') + for net_name in ["net_download", "net_upload"]: + if net_name in new_config and not new_config[net_name][0].isdigit(): # type: ignore + new_config[net_name] = "_error_" return new_config def save_config(self):