Skip to content

Commit 6229a11

Browse files
committed
Merge pull request influxdata#69 from caoli5288/pull
Throw exception when try to set a null TimeUnit.
2 parents 98cdc09 + 7abebc1 commit 6229a11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ public Builder fields(final Map<String, Object> fieldsToAdd) {
124124
* @return the Builder instance.
125125
*/
126126
public Builder time(final long timeToSet, final TimeUnit precisionToSet) {
127+
Preconditions.checkNotNull(precisionToSet, "Precision must be not null!");
127128
this.time = timeToSet;
128-
if (null != precisionToSet) {
129-
this.precision = precisionToSet;
130-
}
129+
this.precision = precisionToSet;
131130
return this;
132131
}
133132

0 commit comments

Comments
 (0)