From e33642c412a0e41f70a611d806a1bd09575661cb Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 17 Oct 2013 16:02:55 +0000 Subject: [PATCH] Don't crash if not opened svn: r23331 --- gramps/plugins/importer/importxml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index 64665b8bb..cfc496b76 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -436,7 +436,8 @@ class ImportOpenFileContextManager: def __exit__(self, exc_type, exc_value, traceback): if self.filename != '-': - self.filehandle.close() + if self.filehandle: + self.filehandle.close() return False def open_file(self, filename):