Skip to content

Commit

Permalink
🐛 Fix issue #135 - return correct null value.
Browse files Browse the repository at this point in the history
The AbstractObjectAttributeDescription.getString() method returns
`String.valueOf((T) data[id])` even if `data[id]` is null. This returns
the String "null" when a float_or_null value is null, which in turn
causes Float.parseFloat() at line 90 in RestUtilities.addData() to
throw a java.lang.NumberFormatException: For input string: "null".

This commit checks for a null value and returns either a non-null
value or null.
  • Loading branch information
algol60 committed Oct 1, 2019
1 parent 36d5e0f commit 59236c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void setCapacity(final int capacity) {

@Override
public String getString(final int id) {
return String.valueOf((T) data[id]);
return data[id]!=null ? String.valueOf((T) data[id]) : null;
}

@Override
Expand Down

0 comments on commit 59236c6

Please sign in to comment.