We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 932bae7 commit a439ac4Copy full SHA for a439ac4
lib/upload/multi.ex
@@ -89,9 +89,15 @@ defmodule Upload.Multi do
89
# This code is run after the record in inserted in the Multi pipeline.
90
# We can use the record ID here to upload the photo.
91
record = Map.get(changes, subject)
92
+
93
+ if is_nil(record) do
94
+ raise ArgumentError,
95
+ "The key '#{subject}' is not in the multi changes: #{inspect(changes)}"
96
+ end
97
98
record = repo.preload(record, fields)
99
- changeset = Ecto.Changeset.cast(record, changeset.params, [])
100
+ changeset = Ecto.Changeset.cast(record, changeset.params || %{}, [])
101
102
changeset =
103
fields
0 commit comments