mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
Fix get_monitors() error when no enumerators available (#4506)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user