Skip to content

Commit

Permalink
If no configuration file is present do not crash.
Browse files Browse the repository at this point in the history
If no configuration file was found, the direct access to the key would
raise an exception, not catched. Using the get method fixes this.
  • Loading branch information
Gu1nness authored and AntoineGagne committed May 16, 2018
1 parent 9e164eb commit dbd9c01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmus_notify/cmus_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def load_notifier(arguments):
:param arguments: The parsed arguments
:returns: The notifier to be used for the notifications
"""
custom_notifier_path = arguments['custom_notification']
custom_notifier_path = arguments.get('custom_notification', None)
if custom_notifier_path:
sys.path.insert(0, os.path.expanduser(os.path.dirname(custom_notifier_path)))
notifier_module = importlib.import_module(os.path.basename(custom_notifier_path))
Expand Down

0 comments on commit dbd9c01

Please sign in to comment.