|
Just discovered the code tag ...
In DefaultGroovyMethods.java, locate the inner class NumberComparator. Instead of public int compare(Object o1, Object o2) { if (o1 instanceof Number && o2 instanceof Number) { ... check for null first: public int compare(Object o1, Object o2) { if (o1 == null) { return o2==null?0:-1; } else if (o2 == null) { return 1; } else if (o1 instanceof Number && o2 instanceof Number) { ... This solves the NPE problem. |
||||||||||||||||||||||||||||||||||||||||||||
Instead of
public int compare(Object o1, Object o2) {
if (o1 instanceof Number && o2 instanceof Number) {
...
check for null first:
public int compare(Object o1, Object o2) {
if (o1 == null) { return o2==null?0:-1; } else if (o2 == null) { return 1; } else if (o1 instanceof Number && o2 instanceof Number) {
...
This solves the NPE problem.