Handle no returned value

master
Bob Mottram 2019-08-18 21:47:12 +01:00
parent c74e865915
commit 600b468409
2 changed files with 8 additions and 5 deletions

View File

@ -276,6 +276,8 @@ def inboxCheckCapabilities(baseDir :str,nickname :str,domain :str, \
getOcapFilename(baseDir, \
queueJson['nickname'],queueJson['domain'], \
actor,'accept')
if not ocapFilename:
return False
if not os.path.isfile(ocapFilename):
if debug:
print('DEBUG: capabilities for '+ \

View File

@ -487,11 +487,12 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
capabilityId=None
capabilityIdList=[]
ocapFilename=getOcapFilename(baseDir,nickname,domain,toUrl,'granted')
if os.path.isfile(ocapFilename):
with open(ocapFilename, 'r') as fp:
oc=commentjson.load(fp)
if oc.get('id'):
capabilityIdList=[oc['id']]
if ocapFilename:
if os.path.isfile(ocapFilename):
with open(ocapFilename, 'r') as fp:
oc=commentjson.load(fp)
if oc.get('id'):
capabilityIdList=[oc['id']]
newPost = {
"@context": "https://www.w3.org/ns/activitystreams",