Fix failure to parse comments when there's one from deleted channel

Specifically, fix failures when any of the fields from the parsed
comment are None, such as author, author_url, etc.
(failure due to string concatenation when building urls).
This commit is contained in:
James Taylor
2020-03-08 16:17:04 -07:00
parent fa112592fa
commit 56e7751da7
2 changed files with 32 additions and 12 deletions

View File

@@ -357,6 +357,15 @@ def left_remove(string, substring):
return string[len(substring):]
return string
def concat_or_none(*strings):
'''Concatenates strings. Returns None if any of the arguments are None'''
result = ''
for string in strings:
if string is None:
return None
result += string
return result
def prefix_urls(item):
try: