From fe6c305a147be3b212be6c974cedda3287756a61 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Wed, 27 Feb 2008 03:03:20 +0000 Subject: [PATCH] 0001835: cli crashes for all reports. NoneType has no attribute get_gramps_id svn: r10126 --- ChangeLog | 5 +++++ src/ReportBase/_CommandLineReport.py | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dd58820cc..9ccb848b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-26 Brian Matherly + * src/ReportBase/_CommandLineReport.py: + 0001835: cli crashes for all reports. NoneType has no attribute + get_gramps_id + 2008-02-26 Benny Malengier * src/ScratchPad.py: bug when dragging sourceref #1833 * src/GrampsDisplay.py: remove whitespace diff --git a/src/ReportBase/_CommandLineReport.py b/src/ReportBase/_CommandLineReport.py index 0f544fe08..57a12b9e7 100644 --- a/src/ReportBase/_CommandLineReport.py +++ b/src/ReportBase/_CommandLineReport.py @@ -28,12 +28,17 @@ # #------------------------------------------------------------------------- from gettext import gettext as _ +import sys import logging log = logging.getLogger(".") +#------------------------------------------------------------------------- +# +# Gramps modules +# +#------------------------------------------------------------------------- import PluginUtils -from BasicUtils import name_displayer import Utils import BaseDoc from ReportBase import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \ @@ -68,6 +73,9 @@ def _initialize_options(options, dbase): if not person: person = dbase.get_default_person() option.set_value(person.get_gramps_id()) + if not person: + print "Please specify a person" + sys.exit(0) elif isinstance(option, PluginUtils.FamilyOption): fid = option.get_value()