summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-02-02 01:09:51 +0100
committernfnty <git@nfnty.se>2017-02-02 01:57:06 +0100
commit13e58248f8b0c34d8e0b54429170cf9e05072d86 (patch)
tree60235c3a0124b7c5e4a32a9e06cb9ff237c60c7a
parent2192e81ae9e435a28874641ce5734e511fb9c974 (diff)
downloadranger-13e58248f8b0c34d8e0b54429170cf9e05072d86.tar.gz
gui.widgets.console.Console: Fix closing when line empty
-rw-r--r--ranger/gui/widgets/console.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index c0655e5c..86a80177 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -441,12 +441,13 @@ class Console(Widget):  # pylint: disable=too-many-instance-attributes,too-many-
     def _get_cmd(self, quiet=False):
         try:
             command_class = self.get_cmd_class()
+        except IndexError:
+            return None
         except KeyError:
             if not quiet:
-                error = "Command not found: `%s'" % self.line.split()[0]
-                self.fm.notify(error, bad=True)
-        else:
-            return command_class(self.line)
+                self.fm.notify("Command not found: `%s'" % self.line.split()[0], bad=True)
+            return None
+        return command_class(self.line)
 
     def get_cmd_class(self):
         return self.fm.commands.get_command(self.line.split()[0])