From f5150b328d19e22cb3cd055b4f20150d44b6c386 Mon Sep 17 00:00:00 2001 From: Rafael Scheffer Date: Thu, 12 Jan 2023 20:13:17 +0100 Subject: [PATCH] Skip serialisation for nil values --- lib/paper_trail/serializer.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paper_trail/serializer.ex b/lib/paper_trail/serializer.ex index 13504d2d..3b002f2d 100644 --- a/lib/paper_trail/serializer.ex +++ b/lib/paper_trail/serializer.ex @@ -184,7 +184,7 @@ defmodule PaperTrail.Serializer do dumped_value = cond do match?({:array, _}, type) and Enum.any?(ignored_ecto_types(), & type == {:array, &1}) -> - Enum.map(value, &serialize_binary/1) + value && Enum.map(value, &serialize_binary/1) type in ignored_ecto_types() -> serialize_binary(value)