add fix for null values in bbjrc

pull/4/head
Blake DeMarcy 2017-04-14 17:05:05 -05:00
parent 42b934929b
commit 2a2a9e8762
1 changed files with 8 additions and 1 deletions

View File

@ -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