From eef99b606f2ab1daabba270cb2f30cdbcf9d9b85 Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Fri, 17 Mar 2023 04:23:34 -0500 Subject: [PATCH] Fix `get_monitors()` error when no enumerators available (#4506) --- openbb_terminal/helper_funcs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index f1ac3ed9447..720e42a3570 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -1213,7 +1213,11 @@ def str_to_bool(value) -> bool: def get_screeninfo(): """Get screeninfo.""" - screens = get_monitors() # Get all available monitors + try: + screens = get_monitors() # Get all available monitors + except Exception: + return None + if screens: current_user = get_current_user() if ( @@ -1228,6 +1232,7 @@ def get_screeninfo(): main_screen = screens[monitor] # Choose what monitor to get return (main_screen.width, main_screen.height) + return None