DBZ-8032 Use better exception than NullPointerException

This commit is contained in:
Chris Cranford 2024-08-29 03:42:55 -04:00 committed by Chris Cranford
parent c4fc9123b2
commit 7423ee0294

View File

@ -434,7 +434,13 @@ protected void createSchemaChangeEventsForTables(ChangeEventSourceContext source
lastSnapshotRecord(snapshotContext);
}
SchemaChangeEvent event = getCreateTableEvent(snapshotContext, snapshotContext.tables.forTable(tableId));
final Table table = snapshotContext.tables.forTable(tableId);
if (table == null) {
throw new DebeziumException("Unable to find relational table model for '" + tableId +
"', there may be an issue with your include/exclude list configuration.");
}
SchemaChangeEvent event = getCreateTableEvent(snapshotContext, table);
if (HistorizedRelationalDatabaseSchema.class.isAssignableFrom(schema.getClass()) &&
((HistorizedRelationalDatabaseSchema) schema).skipSchemaChangeEvent(event)) {
continue;