Skip to content

Commit 9a29352

Browse files
EmoonXjntesteves
authored andcommitted
Use dict.get(key) for handling possibly null keys
1 parent 7b10c19 commit 9a29352

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bottles/frontend/windows/launchoptions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def set_path(dialog, result):
252252
# also thrown when dialog has been cancelled
253253
if error.code == 2:
254254
# error 2 seems to be 'dismiss' or 'cancel'
255-
if self.program["pre_script"] in (None, ""):
255+
if self.program.get("pre_script") in (None, ""):
256256
self.action_pre_script.set_subtitle(
257257
self.__default_pre_script_msg
258258
)
@@ -282,7 +282,7 @@ def set_path(dialog, result):
282282
# also thrown when dialog has been cancelled
283283
if error.code == 2:
284284
# error 2 seems to be 'dismiss' or 'cancel'
285-
if self.program["post_script"] in (None, ""):
285+
if self.program.get("post_script") in (None, ""):
286286
self.action_pre_script.set_subtitle(
287287
self.__default_pre_script_msg
288288
)
@@ -322,7 +322,7 @@ def set_path(dialog, result):
322322
# also thrown when dialog has been cancelled
323323
if error.code == 2:
324324
# error 2 seems to be 'dismiss' or 'cancel'
325-
if self.program["folder"] in (None, ""):
325+
if self.program.get("folder") in (None, ""):
326326
self.action_cwd.set_subtitle(self.__default_cwd_msg)
327327
else:
328328
# something else happened...

0 commit comments

Comments
 (0)