Fix subattachment target parsing, fixes #412

This commit is contained in:
Mads Marquart
2019-04-25 23:03:05 +02:00
parent db2bda1f9b
commit f480d68b57

View File

@@ -268,8 +268,10 @@ def graphql_to_attachment(data):
def graphql_to_subattachment(data):
_type = data["target"]["__typename"]
if _type == "Video":
target = data.get("target")
type_ = target.get("__typename") if target else None
if type_ == "Video":
return VideoAttachment._from_subattachment(data)
return None