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. """