From 258066560037cd2c09916474d014657d63153ec9 Mon Sep 17 00:00:00 2001 From: "Craig J. Anderson" Date: Mon, 2 Jul 2012 13:41:58 +0000 Subject: [PATCH] Fixed a small error where $P in a person box when the person has not been married does not remove the format string. Found by Adam Stein. svn: r19944 --- src/plugins/lib/libsubstkeyword.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/lib/libsubstkeyword.py b/src/plugins/lib/libsubstkeyword.py index 5266ad667..42f6a5032 100644 --- a/src/plugins/lib/libsubstkeyword.py +++ b/src/plugins/lib/libsubstkeyword.py @@ -816,15 +816,14 @@ class VariableParse(object): return None def __parse_photo(self, person_or_marriage): - if person_or_marriage is None: - return - photo = self.__get_photo(person_or_marriage) photo_f = GalleryFormat(self.database, self._in) + if person_or_marriage is None: + return photo_f.parse_empty() + photo = self.__get_photo(person_or_marriage) if photo: return photo_f.parse_format(photo) else: - photo_f.parse_empty() - return + return photo_f.parse_empty() def parse_format(self): """Parse the $ variables. """