[instagram] prevent crash on empty user profile

pull/3028/head
Mike Fährmann 2 years ago
parent b57015cf0a
commit 36afb519b3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -702,6 +702,9 @@ class InstagramRestAPI():
if screen_name.startswith("id:"):
return screen_name[3:]
user = self.user(screen_name)
if user is None:
raise exception.AuthorizationError(
"Login required to access this profile")
if user["is_private"] and not user["followed_by_viewer"]:
name = user["username"]
s = "" if name.endswith("s") else "s"

Loading…
Cancel
Save