From 8c8c279cd0b3f78c81c6773ffd68ca4d48a9de0a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 18 Jul 2021 20:08:17 +0100 Subject: [PATCH] Itterate through list --- utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 9d2dabce9..fc567e6a3 100644 --- a/utils.py +++ b/utils.py @@ -2567,6 +2567,8 @@ def validUrlPrefix(url: str) -> bool: def getActorLanguagesList(actorJson: {}) -> []: """Returns a list containing languages used by the given actor """ + if not actorJson.get('attachment'): + return [] for propertyValue in actorJson['attachment']: if not propertyValue.get('name'): continue @@ -2591,7 +2593,7 @@ def getActorLanguages(actorJson: {}) -> str: if not langList: return '' languagesStr = '' - for lang in languagesStr: + for lang in langList: if languagesStr: languagesStr += ' / ' + lang else: