diff --git a/sub.py b/sub.py index a0270c1..5708a89 100755 --- a/sub.py +++ b/sub.py @@ -39,7 +39,11 @@ def editSub(num): sub = getSub(getItem(num)) if sub is None: sys.exit("This item does not have a sub") - editor = os.getenv("EDITOR").split() + editor = os.getenv("EDITOR") + if editor is not None and editor != "": + editor = editor.split() + else: + sys.exit("$EDITOR is unset, cannot edit") subprocess.call(editor + [os.path.join(os.getenv("TODO_DIR"), sub[0], sub[1])]) def showSub(item, indent=0, color=True):