Skip to content

Commit

Permalink
Guard against missing data (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilsoncoding authored Jun 19, 2024
1 parent d7392c8 commit 5c432c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/broadway_cloud_pub_sub/pull_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ defmodule BroadwayCloudPubSub.PullClient do
end

defp decode_message(%{"data" => nil} = message), do: message
defp decode_message(%{"attributes" => %{"payloadFormat" => "NONE"}} = message), do: message
defp decode_message(%{} = message) when not is_map_key(message, "data"), do: message

defp headers(config) do
token = get_token(config)
Expand Down

0 comments on commit 5c432c0

Please sign in to comment.