Skip to content

Commit

Permalink
Fix TypeError when event_date is None
Browse files Browse the repository at this point in the history
A TypeError occurs when trying to concat event_date returning None with the timezone string but there is a further error where setPath only accepts a single string arg but multiple args are provided.

Fixed by providing a fallback and also combining the entire string passed to setPatch
  • Loading branch information
cas-- committed Jun 25, 2022
1 parent 3a9c8e9 commit f482be1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/lib/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def generate_list_item(element, element_type):
elif element.get('type') == 'video' and element.get('status').get('label') == 'Upcoming':
info_labels['premiered'] = element.get('status').get('start_time')
from time import timezone
list_item.setPath('/notify/' + localize(30024), localize(30025), element.get('event_date') + ' (GMT+' + str(timezone / 3600 * -1))
list_item.setPath('/notify/' + localize(30024) + localize(30025) + element.get('event_date', 'Today') + ' (GMT+' + str(timezone / 3600 * -1))
elif element_type == COLLECTION:
list_item.setPath(plugin.url_for(browse_collection, uid=uid))
elif element_type == PRODUCT:
Expand Down

0 comments on commit f482be1

Please sign in to comment.