Skip to content

Commit 5cdc9e3

Browse files
authored
Merge pull request #638 from maanasa/nullchecksinpojo
Allow only non null values to flow to influxDB
2 parents ffa2fe2 + 6afc6ad commit 5cdc9e3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/influxdb/dto/Point.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,13 @@ private void addFieldByAttribute(final Object pojo, final Field field, final Col
276276
}
277277

278278
if (column.tag()) {
279-
this.tags.put(fieldName, (String) fieldValue);
279+
if (fieldValue != null) {
280+
this.tags.put(fieldName, (String) fieldValue);
281+
}
280282
} else {
281-
this.fields.put(fieldName, fieldValue);
283+
if (fieldValue != null) {
284+
this.fields.put(fieldName, fieldValue);
285+
}
282286
}
283287

284288
} catch (IllegalArgumentException | IllegalAccessException e) {

0 commit comments

Comments
 (0)