Skip to content

Commit

Permalink
Fix crash when restoring programs
Browse files Browse the repository at this point in the history
There was a crash when restoring programs thrown by list.remove() because
I was not checking if a program was in the saved programs list before
removing it.
  • Loading branch information
JonnyHaystack committed Nov 18, 2019
1 parent e57c9b7 commit 9820c7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i3_resurrect/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def restore(workspace_name, saved_programs):
# Remove already running programs from the list of program to restore.
running_programs = get_programs(workspace_name, False)
for program in running_programs:
saved_programs.remove(program)
if program in saved_programs:
saved_programs.remove(program)

i3 = i3ipc.Connection()
for entry in saved_programs:
Expand Down

0 comments on commit 9820c7b

Please sign in to comment.