mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
improvement: don't call .table
on nil
snapshot
This commit is contained in:
parent
86e02d2fe9
commit
aec9e1578e
1 changed files with 1 additions and 3 deletions
|
@ -122,11 +122,9 @@ defmodule AshPostgres.MigrationGenerator do
|
|||
}
|
||||
end
|
||||
|
||||
defp find_references_primary_key(nil, _), do: nil
|
||||
|
||||
defp find_references_primary_key(references, snapshots) do
|
||||
Enum.find_value(snapshots, false, fn snapshot ->
|
||||
if snapshot.table == references.table do
|
||||
if snapshot && references && snapshot.table == references.table do
|
||||
Enum.any?(snapshot.attributes, fn attribute ->
|
||||
attribute.source == references.destination_attribute
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue