From 0671d49497f42ed5b7ae928f9d83002bf93fed08 Mon Sep 17 00:00:00 2001 From: kinoshitakenta Date: Wed, 28 May 2025 15:45:01 +0800 Subject: [PATCH] feat: validates config path before loading login info Adds a check to ensure the provided configuration file path exists and is a valid file before attempting to load login information. --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1a666de..15b1165 100644 --- a/main.py +++ b/main.py @@ -36,7 +36,12 @@ def display_usage(): def main(opt): - login_info = LoginInfo(Path(opt.config_path)) + config_path = Path(opt.config_path) + if not config_path.exists() or not config_path.is_file(): + print(f"Error: Config path '{config_path}' does not exist or is not a file.") + return + + login_info = LoginInfo(config_path) driver = get_driver() keep_login_status(driver, login_info)