Check newswire for no return value

merge-requests/8/head
Bob Mottram 2020-11-03 14:41:28 +00:00
parent 9f70a96f51
commit 4c1553e1e7
2 changed files with 8 additions and 0 deletions

View File

@ -471,6 +471,9 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
maxMirroredArticles: int) -> None:
"""Converts rss items in a newswire into posts
"""
if not newswire:
return
basePath = baseDir + '/accounts/news@' + domain + '/outbox'
if not os.path.isdir(basePath):
os.mkdir(basePath)
@ -669,6 +672,9 @@ def mergeWithPreviousNewswire(oldNewswire: {}, newNewswire: {}) -> None:
"""Preserve any votes or generated activitypub post filename
as rss feeds are updated
"""
if not oldNewswire:
return
for published, fields in oldNewswire.items():
if not newNewswire.get(published):
continue

View File

@ -354,6 +354,8 @@ def getRSSfromDict(baseDir: str, newswire: {},
rssStr = rss2Header(httpPrefix,
None, domainFull,
'Newswire', translate)
if not newswire:
return ''
for published, fields in newswire.items():
if '+00:00' in published:
published = published.replace('+00:00', 'Z').strip()