From ec0e3724c6e04216e8522c44083bfe9458299261 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Wed, 4 Jan 2012 21:17:56 +0000 Subject: [PATCH] Added a conditional to make sure that there was a citation before creating hyper links. svn: r18702 --- src/plugins/webreport/NarrativeWeb.py | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 7c22851a2..403f7dad9 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -713,29 +713,27 @@ class BasePage(object): @param: citation_handle_list = list of gen/lib/Citation """ - lnk = (self.report.cur_fname, self.page_title, self.gid) text = "" for citation_handle in citation_handle_list: citation = self.report.database.get_citation_from_handle( citation_handle) + if citation: - # Add the source information to src_list for use when displaying the - # Sources page - source_handle = citation.get_reference_handle() - if source_handle in self.src_list: - if lnk not in self.src_list[source_handle]: - self.src_list[source_handle].append(lnk) - else: - self.src_list[source_handle] = [lnk] + # Add the source information to src_list for use when displaying the + # Sources page + source_handle = citation.get_reference_handle() + if source_handle in self.src_list: + if lnk not in self.src_list[source_handle]: + self.src_list[source_handle].append(lnk) + else: + self.src_list[source_handle] = [lnk] - # Add the citation information to the bibliography, and construct - # the citation reference text - index, key = self.bibli.add_reference(citation) - id_ = "%d%s" % (index+1, key) - text += ' [%s]' % (id_, id_) - - # return citation list text to its callers + # Add the citation information to the bibliography, and construct + # the citation reference text + index, key = self.bibli.add_reference(citation) + id_ = "%d%s" % (index+1, key) + text += ' [%s]' % (id_, id_) return text def get_note_format(self, note, link_prefix_up):