From 0edaf5fadc0fed2ab9618f6bb0aa2f0042a60e42 Mon Sep 17 00:00:00 2001 From: Joe Williams Date: Thu, 29 Aug 2024 15:11:38 -0400 Subject: [PATCH] fix: LegacyFCM handle nil and replace with unknown (#266) --- lib/pigeon/legacy_fcm/config.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pigeon/legacy_fcm/config.ex b/lib/pigeon/legacy_fcm/config.ex index 89da6614..363660fe 100644 --- a/lib/pigeon/legacy_fcm/config.ex +++ b/lib/pigeon/legacy_fcm/config.ex @@ -167,7 +167,7 @@ defimpl Pigeon.Configurable, for: Pigeon.LegacyFCM.Config do def parse_error(data) do case Pigeon.json_library().decode(data) do {:ok, response} -> - response["reason"] |> Macro.underscore() |> String.to_existing_atom() + (response["reason"] || "unknown") |> Macro.underscore() |> String.to_existing_atom() error -> "JSON parse failed: #{inspect(error)}, body: #{inspect(data)}"