Skip to content

Commit 6955c9d

Browse files
committed
Error handling for restore_window
1 parent 995d197 commit 6955c9d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

castervoice/lib/utilities.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ def minimize_window():
8484
Window.get_foreground().minimize()
8585

8686
def restore_window():
87+
'''
88+
Restores last minimized window triggered minimize_window.
89+
'''
8790
global lasthandle
88-
Window.restore(lasthandle)
91+
if lasthandle is None:
92+
printer.out("No previous window minimized by voice")
93+
else:
94+
Window.restore(lasthandle)
8995

9096
def get_active_window_info():
9197
'''Returns foreground window executable_file, executable_path, title, handle, classname'''

0 commit comments

Comments
 (0)