diff options
author | Pol Van Aubel <dev@polvanaubel.com> | 2019-10-28 17:08:31 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2019-11-02 16:46:37 +0000 |
commit | 39506c4209124f923aac49bd7065082832d017ad (patch) | |
tree | 4c78fcbb0f8cd35b06de1a5ea6af41a549b64ef7 | |
parent | f07c405cee19a4549e897a07303cf406dcc56a66 (diff) |
Fix crash when editor_cmdstring is empty.
Bypasses the inspection of editor_cmdstring if it is still None after
all attempts to fill it. This will eventually lead to EditCommand.apply
erroring with 'no editor set' instead of alot crashing.
Fixes #1438
-rw-r--r-- | alot/commands/globals.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 05ab6427..718a4eba 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -340,12 +340,13 @@ class EditCommand(ExternalCommand): logging.debug('using editor_cmd: %s', editor_cmdstring) self.cmdlist = None - if '%s' in editor_cmdstring: - cmdstring = editor_cmdstring.replace('%s', - helper.shell_quote(path)) - self.cmdlist = split_commandstring(cmdstring) - else: - self.cmdlist = split_commandstring(editor_cmdstring) + [path] + if editor_cmdstring: + if '%s' in editor_cmdstring: + cmdstring = editor_cmdstring.replace('%s', + helper.shell_quote(path)) + self.cmdlist = split_commandstring(cmdstring) + else: + self.cmdlist = split_commandstring(editor_cmdstring) + [path] logging.debug({'spawn: ': self.spawn, 'in_thread': self.thread}) ExternalCommand.__init__(self, self.cmdlist, |