Skip to content

Commit

Permalink
Merge pull request #4 from amplifiedai/simon/avoid-crash
Browse files Browse the repository at this point in the history
Avoid crash with nil struct and list of changes
  • Loading branch information
simoncocking authored Aug 7, 2023
2 parents 8cc45cd + f90136d commit 7a27611
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/diff/patch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule ExAudit.Patch do
"""
def patch(_, {:primitive_change, _, value}), do: value
def patch(value, :not_changed), do: value
def patch(nil, changes) when is_list(changes), do: patch([], changes)

def patch(list, changes) when is_list(list) and is_list(changes) do
changes
Expand Down

0 comments on commit 7a27611

Please sign in to comment.