From 2f9ebbab0dc235bc8a15ad238548e3edbc2bf0a5 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Thu, 12 May 2005 07:37:33 +0000 Subject: [PATCH] * src/plugins/NavWebPage.py (HomePage): Dont crash on note only object svn: r4561 --- gramps2/ChangeLog | 1 + gramps2/src/plugins/NavWebPage.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 54bc8f584..ed7e4e253 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,7 @@ 2005-05-12 Martin Hawlisch * src/plugins/TestcaseGenerator.py: Added generation of multiple date formats including invalid dates. + * src/plugins/NavWebPage.py (HomePage): Dont crash on note only object 2005-05-11 Don Allingham * src/ReadGedcom.py: coerce the name into a unicode value - if the wrong character diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 3a79592f5..8e14cb246 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -401,7 +401,8 @@ class HomePage(BasePage): if not obj: print "%s object not found" % note_id else: - if obj.get_mime_type()[0:5] == "image": + mime_type = obj.get_mime_type() + if mime_type and mime_type.startswith("image"): newpath = obj.gramps_id + os.path.splitext(obj.get_path())[1] shutil.copyfile(obj.get_path(), os.path.join(html_dir,newpath))