Skip to content

Commit

Permalink
Merge pull request #5917 from ayeung/timob-16562
Browse files Browse the repository at this point in the history
[TIMOB-16562] Fix NPE in Ticonvert
  • Loading branch information
jonalter committed Jul 18, 2014
2 parents 82fd1b1 + 5d59440 commit 58198c6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public static Object putInKrollDict(KrollDict d, String key, Object value)
d.put(key,dict);

} else {
throw new IllegalArgumentException("Unsupported property type " + value.getClass().getName());
throw new IllegalArgumentException("Unsupported property type "
+ (value == null ? "null" : value.getClass().getName()));
}

return value;
Expand Down Expand Up @@ -404,7 +405,7 @@ public static int toInt(Object value)
return Integer.parseInt((String) value);

} else {
throw new NumberFormatException("Unable to convert " + value);
throw new NumberFormatException("Unable to convert " + (value == null ? "null" : value));
}
}

Expand Down Expand Up @@ -524,7 +525,7 @@ public static double toDouble(Object value)
return Double.parseDouble((String) value);

} else {
throw new NumberFormatException("Unable to convert " + value.getClass().getName());
throw new NumberFormatException("Unable to convert " + (value == null ? "null" : value.getClass().getName()));
}
}

Expand Down

0 comments on commit 58198c6

Please sign in to comment.