diff --git a/changelog.d/362.bugfix b/changelog.d/362.bugfix new file mode 100644 index 00000000..a3d3a394 --- /dev/null +++ b/changelog.d/362.bugfix @@ -0,0 +1 @@ +Fix a bug causing Sygnal to fail when processing notifications without a `content` dict, when those notifications were destined for GCM. Contributed by @c-cal. diff --git a/sygnal/gcmpushkin.py b/sygnal/gcmpushkin.py index 1177c0aa..621c2fd7 100644 --- a/sygnal/gcmpushkin.py +++ b/sygnal/gcmpushkin.py @@ -669,7 +669,7 @@ def _build_data( data[attr] = data[attr][0:MAX_BYTES_PER_FIELD] if api_version is APIVersion.V1: - if "content" in data: + if isinstance(data.get("content"), dict): for attr, value in data["content"].items(): if not isinstance(value, str): continue