NPE in ForeignKeyComparator

Description

When performing the dropAll command, a NullPointerException gets thrown in ForeignKeyComparator.

This is the complete stacktrace:

java.lang.NullPointerException
at liquibase.diff.compare.core.ForeignKeyComparator.isSameObject(ForeignKeyComparator.java:41)
at liquibase.diff.compare.DatabaseObjectComparatorChain.isSameObject(DatabaseObjectComparatorChain.java:39)
at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:92)
at liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:164)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:59)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:42)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:62)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:42)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:75)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:124)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:124)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:124)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:124)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:144)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:157)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:94)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:128)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:121)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:109)
at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:869)
at liquibase.Liquibase.dropAll(Liquibase.java:550)
at liquibase.Liquibase.dropAll(Liquibase.java:537)
at LiquiTest.main(LiquiTest.java:52)

I think this was introduced with the following commit:
https://github.com/liquibase/liquibase/commit/921adca4cb468bb7efada34baf580aae0f7348b9

Environment

H2 Database, Windows 7 x64

Status

Assignee

Unassigned

Reporter

Marco Perazzo

Labels

None

Fix versions

Affects versions

3.0.3

Priority

Blocker