[jOOQ/jOOQ#11287] NullPointerException in AbstractMeta.copyFK for SQLite

when a foreign key references a unique key
This commit is contained in:
Lukas Eder 2021-01-22 13:35:56 +01:00
parent dc528e2f46
commit 6bca99f0db

View File

@ -250,7 +250,15 @@ final class Snapshot extends AbstractMeta {
// ReferenceImpl in this list until we "know better"?
for (int i = 0; i < foreignKeys.size(); i++) {
ForeignKey<R, ?> fk = foreignKeys.get(i);
foreignKeys.set(i, copyFK(this, lookupUniqueKey(fk), fk));
UniqueKey<?> uk = lookupUniqueKey(fk);
// [#10823] [#11287] There are numerous reasons why a UNIQUE
// constraint may not be known to our meta model. Let's just
// prevent exceptions here
if (uk == null)
foreignKeys.remove(i);
else
foreignKeys.set(i, copyFK(this, uk, fk));
}
}