From c32f82dbf0792766a8d1084324c1b94d8990aa36 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 17 Jan 2015 03:57:37 +0100 Subject: container.directory: don't crash get_selection if files is None --- ranger/container/directory.py | 2 ++ 1 file changed, 2 insertions(+) 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: -- cgit 1.4.1-2-gfad0