Skip to content

Commit

Permalink
Don't raise if a struct field does not exist
Browse files Browse the repository at this point in the history
This allows us to patch old versions of a struct which has been migrated to add new fields
  • Loading branch information
simoncocking committed Jul 12, 2022
1 parent 5f4f169 commit 0dad5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/diff/patch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule ExAudit.Patch do
Map.delete(map, key)

{key, {:changed, changes}}, map ->
Map.update!(map, key, &patch(&1, changes))
Map.update(map, key, nil, &patch(&1, changes))
end)
end
end

0 comments on commit 0dad5b3

Please sign in to comment.