From 445421051c5d364839d3bcdf2fa35e3ecd06e9bc Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 6 Jan 2014 10:43:51 +0000 Subject: [PATCH] potential NPE --- .../org/apache/maven/artifact/versioning/ComparableVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java index 6f066140dc..e79b238561 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java @@ -309,7 +309,7 @@ public class ComparableVersion Item r = right.hasNext() ? right.next() : null; // if this is shorter, then invert the compare and mul with -1 - int result = l == null ? -1 * r.compareTo( l ) : l.compareTo( r ); + int result = l == null ? ( r == null ? 0 : -1 * r.compareTo( l ) ) : l.compareTo( r ); if ( result != 0 ) {