From a1278b1d7353a4bc33ac2d725cac1dcdfdc10405 Mon Sep 17 00:00:00 2001 From: Michael Schierl Date: Sat, 2 Sep 2017 19:46:55 +0200 Subject: [PATCH] Fix inverted condition Found by Eclipse's static null value analyzer. It makes no sense to set the value to 0 if it is not null. That way, null remains null (and will create a NPE in line 123), and all other values get overwritten by 0. Therefore, overwrite null by zero, fixing both warnings. --- src/main/java/jota/IotaAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 5cc5637..6f2df1e 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -118,7 +118,7 @@ public class IotaAPI extends IotaAPICore { throw new InvalidSecurityLevelException(); } - start = start != null ? 0 : start; + start = start == null ? 0 : start; if (start > end || end > (start + 500)) { throw new ArgumentException();