Skip to content

Commit b0bf2c3

Browse files
committed
Fix bug where 'None' strings were being looked up and failing.
1 parent 164059c commit b0bf2c3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

plugin.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -631,17 +631,18 @@ def _shouldAnnounceChangeInChannel(self, diff, channel):
631631
##############################
632632

633633
def _field_text_to_string(self, obj, field, channel):
634-
field_lookup_list = self.plugin.registryValue('fieldLookupList', channel)
635-
636-
for field_lookup in field_lookup_list:
637-
# Get current field, class and classname in the list.
638-
(lfield, lclass, lclassfield) = field_lookup.split('.')
639-
# See if we have found our field.
640-
if field.lower() == lfield:
641-
# Found it, so get appropriate data and return appropriate
642-
# field.
643-
field_csv = self._getCsvByIds(lclass, [obj[field]], channel)
644-
return "%s" % [thing for thing in field_csv][0][lclassfield]
634+
if obj[field] and obj[field] != 'None':
635+
field_lookup_list = self.plugin.registryValue('fieldLookupList', channel)
636+
637+
for field_lookup in field_lookup_list:
638+
# Get current field, class and classname in the list.
639+
(lfield, lclass, lclassfield) = field_lookup.split('.')
640+
# See if we have found our field.
641+
if field.lower() == lfield:
642+
# Found it, so get appropriate data and return appropriate
643+
# field.
644+
field_csv = self._getCsvByIds(lclass, [obj[field]], channel)
645+
return "%s" % [thing for thing in field_csv][0][lclassfield]
645646

646647
# Didn't find the field so doesn't need reworking.
647648
return '%s' % obj[field]

0 commit comments

Comments
 (0)