summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortaylorchu <tailinchu@gmail.com>2014-04-05 23:13:37 -0700
committertaylorchu <tailinchu@gmail.com>2014-04-05 23:13:37 -0700
commiteb26387a52b8fbfc93d37ec18952e0837cbf9caf (patch)
tree219669e71af57cb27c41e1cb17fb753285deef50
parent95460bf2f76fc83decfc4119f4c8a21c59cbd3b3 (diff)
downloadranger-eb26387a52b8fbfc93d37ec18952e0837cbf9caf.tar.gz
improve keyerror fix
-rw-r--r--ranger/container/file.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/container/file.py b/ranger/container/file.py
index f92ffadb..ab677125 100644
--- a/ranger/container/file.py
+++ b/ranger/container/file.py
@@ -92,4 +92,7 @@ class File(FileSystemObject):
         return self.fm.get_preview(self, width, height)
 
     def is_image_preview(self):
-        return self.realpath in self.fm.previews and 'imagepreview' in self.fm.previews[self.realpath]
+        try:
+            return self.fm.previews[self.realpath]['imagepreview']
+        except KeyError:
+            return False