From 2a2a9e8762616b85b3f4d2d031c87db7a57a20eb Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Fri, 14 Apr 2017 17:05:05 -0500 Subject: [PATCH] add fix for null values in bbjrc --- clients/urwid/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 9549907..20695e3 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -163,7 +163,8 @@ colornames = ["none", "red", "yellow", "green", "blue", "cyan", "magenta"] editors = ["nano", "vim", "emacs", "vim -u NONE", "emacs -Q", "micro", "ed", "joe"] default_prefs = { - "editor": os.getenv("EDITOR", default="nano"), + # using default= is not completely reliable, sadly... + "editor": os.getenv("EDITOR") or "nano", "shift_multiplier": 5, "integrate_external_editor": True, "dramatic_exit": True, @@ -1589,6 +1590,12 @@ def bbjrc(mode, **params): for key, default_value in default_prefs.items(): if key not in values: values[key] = default_value + elif values[key] == None: + # HACK: settings should never be null, ~vilmibm ran into + # a null value and im not sure where. putting this here + # to correct it automatically for anyone else that may + # have been affected + values[key] = default_value # else make one except FileNotFoundError: values = default_prefs