Skip to content

Commit

Permalink
flat-records: throw exception when schema cannot be found instead of …
Browse files Browse the repository at this point in the history
…npe (#684)
  • Loading branch information
eduardoramirez authored Jul 2, 2024
1 parent 67625e2 commit 63d369b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public FlatRecord(ByteData recordData, HollowSchemaIdentifierMapper schemaIdMapp

int topRecordSchemaId = VarInt.readVInt(recordData, dataStartByte + locationOfTopRecord);
HollowSchema topRecordSchema = schemaIdMapper.getSchema(topRecordSchemaId);
if (topRecordSchema == null) {
throw new IllegalStateException("Could not find schema for schemaId " + topRecordSchemaId);
}

if (topRecordSchema.getSchemaType() == SchemaType.OBJECT) {
PrimaryKey primaryKey = ((HollowObjectSchema) topRecordSchema).getPrimaryKey();
Expand Down

0 comments on commit 63d369b

Please sign in to comment.