From ba9429c31f77f522f2d4dd0e9a79227ae74687fd Mon Sep 17 00:00:00 2001 From: yrizhkov Date: Wed, 29 Nov 2023 12:05:43 +0200 Subject: [PATCH] check the returned bin map for null --- .../jdbc/schema/AerospikeSchemaBuilder.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/aerospike/jdbc/schema/AerospikeSchemaBuilder.java b/src/main/java/com/aerospike/jdbc/schema/AerospikeSchemaBuilder.java index 716f693..b047276 100644 --- a/src/main/java/com/aerospike/jdbc/schema/AerospikeSchemaBuilder.java +++ b/src/main/java/com/aerospike/jdbc/schema/AerospikeSchemaBuilder.java @@ -48,14 +48,16 @@ public static List getSchema(SchemaTableName schemaTableName, IAeros client.scanAll(policy, schemaTableName.getSchemaName(), toSet(schemaTableName.getTableName()), (key, rec) -> { Map bins = rec.bins; - bins.forEach((k, value) -> { - logger.fine(() -> String.format("Bin: %s -> %s", k, value)); - int t = getBinType(value); - if (k != null && t != 0) { - columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(), - schemaTableName.getTableName(), t, k, k)); - } - }); + if (bins != null) { + bins.forEach((k, value) -> { + logger.fine(() -> String.format("Bin: %s -> %s", k, value)); + int t = getBinType(value); + if (k != null && t != 0) { + columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(), + schemaTableName.getTableName(), t, k, k)); + } + }); + } }); List columns = new ArrayList<>(columnHandles.values());