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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user