Don't close empty object
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Fri, 2 Nov 2012 13:16:15 +0000 (14:16 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Fri, 2 Nov 2012 13:16:15 +0000 (14:16 +0100)
apps/search/index.py

index 66a7b34..f09a42e 100644 (file)
@@ -93,7 +93,8 @@ class Snippets(object):
 
     def close(self):
         """Close snippet file"""
-        self.file.close()
+        if self.file:
+            self.file.close()
 
     def remove(self):
         self.revision = None