Skip to content

Commit ba9429c

Browse files
committed
check the returned bin map for null
1 parent 89a3d9a commit ba9429c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/com/aerospike/jdbc/schema/AerospikeSchemaBuilder.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ public static List<DataColumn> getSchema(SchemaTableName schemaTableName, IAeros
4848

4949
client.scanAll(policy, schemaTableName.getSchemaName(), toSet(schemaTableName.getTableName()), (key, rec) -> {
5050
Map<String, Object> bins = rec.bins;
51-
bins.forEach((k, value) -> {
52-
logger.fine(() -> String.format("Bin: %s -> %s", k, value));
53-
int t = getBinType(value);
54-
if (k != null && t != 0) {
55-
columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(),
56-
schemaTableName.getTableName(), t, k, k));
57-
}
58-
});
51+
if (bins != null) {
52+
bins.forEach((k, value) -> {
53+
logger.fine(() -> String.format("Bin: %s -> %s", k, value));
54+
int t = getBinType(value);
55+
if (k != null && t != 0) {
56+
columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(),
57+
schemaTableName.getTableName(), t, k, k));
58+
}
59+
});
60+
}
5961
});
6062

6163
List<DataColumn> columns = new ArrayList<>(columnHandles.values());

0 commit comments

Comments
 (0)