Permalink
Browse files

Fix NPE in issue #85

  • Loading branch information...
1 parent 8af7860 commit f7de66797bf7e38bc529a1aee005d493b7f8f8ba @jankotek committed Aug 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/org/apache/jdbm/Utils.java
@@ -47,7 +47,7 @@
*/
static final Comparator COMPARABLE_COMPARATOR = new Comparator<Comparable>() {
public int compare(Comparable o1, Comparable o2) {
- return o1.compareTo(o2);
+ return o1 == null && o2 != null ? -1 : (o1 != null && o2 == null ? 1 : o1.compareTo(o2));
}
};

0 comments on commit f7de667

Please sign in to comment.