Skip to content

Commit

Permalink
Avoid crash with nil struct and list of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncocking committed Aug 7, 2023
1 parent 8cc45cd commit f90136d
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 f90136d

Please sign in to comment.