From: Marcin Koziej Date: Fri, 2 Nov 2012 13:16:15 +0000 (+0100) Subject: Don't close empty object X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/4291cfb8aed27b119552f6334e0e5ee38ebd1ceb?ds=inline;hp=--cc Don't close empty object --- 4291cfb8aed27b119552f6334e0e5ee38ebd1ceb diff --git a/apps/search/index.py b/apps/search/index.py index 66a7b3420..f09a42e53 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -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