summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-01-17 03:57:37 +0100
committerhut <hut@lepus.uberspace.de>2015-01-17 03:57:37 +0100
commitc32f82dbf0792766a8d1084324c1b94d8990aa36 (patch)
tree1c57cd574ebf81f7f3e8eec7d1a5209a4f1d13ea
parent80c0a1fc8701f4105250a9eabc5e730109574045 (diff)
downloadranger-c32f82dbf0792766a8d1084324c1b94d8990aa36.tar.gz
container.directory: don't crash get_selection if files is None
-rw-r--r--ranger/container/directory.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 486b23fe..3a609cf6 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -185,6 +185,8 @@ class Directory(FileSystemObject, Accumulator, Loadable):
     def get_selection(self):
         """READ ONLY"""
         self._gc_marked_items()
+        if not self.files:
+            return []
         if self.marked_items:
             return [item for item in self.files if item.marked]
         elif self.pointed_obj: