From e0d9715629ad1da3f6ef3a615f48f6437b0e362c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 20 Aug 2019 21:23:35 +0100 Subject: [PATCH] Create items --- like.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/like.py b/like.py index 45f5f75e8..7e7f463b0 100644 --- a/like.py +++ b/like.py @@ -70,6 +70,9 @@ def likedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool: return False if not postJsonObject['object'].get('likes'): return False + if not postJsonObject['object']['likes'].get('items'): + postJsonObject['object']['likes']['items']=[] + postJsonObject['object']['likes']['totalItems']=0 actorMatch=domain+'/users/'+nickname for item in postJsonObject['object']['likes']['items']: if item['actor'].endswith(actorMatch):