NullPointerException when adding feedparser-clj as a dependency #13

carlosmn opened this Issue Nov 7, 2012 · 1 comment

2 participants


Adding [org.clojars.scsibug/feedparser-clj "0.4.0"] to the dependency list in an otherwise untouched project, I get an exception when trying to compile, which points to classpath.clj:36 passing in nil to .parseVersion. The top of the stack trace is:

Compiling Clojure files...
    at org.sonatype.aether.util.version.GenericVersion$Tokenizer.<init>(
    at org.sonatype.aether.util.version.GenericVersion.parse(
    at org.sonatype.aether.util.version.GenericVersion.<init>(
    at org.sonatype.aether.util.version.GenericVersionScheme.parseVersion(
    at leiningen.droid.classpath$remove_duplicate_dependencies$iter__1613__1617$fn__1618$fn__1629.invoke(classpath.clj:36)
    at clojure.lang.ArrayChunk.reduce(

This quick-n-dirty change lets it pass, but there's bound to be a root cause somewhere else.

diff --git a/src/leiningen/droid/classpath.clj b/src/leiningen/droid/classpath.clj
index a9d781b..c4073fc 100644
--- a/src/leiningen/droid/classpath.clj
+++ b/src/leiningen/droid/classpath.clj
@@ -33,8 +33,10 @@
-         (reduce #(if (pos? (compare (.parseVersion scheme (:version %2))
-                                     (.parseVersion scheme (:version %1))))
+         (reduce #(if (pos? (compare (.parseVersion scheme (let [v (:version %2)]
+                                                             (if (= v nil) "0" v)))
+                                     (.parseVersion scheme (let [v (:version %1)]
+                                                             (if (= v nil) "0" v)))))
                     %2 %1)

Clojure/Android member

Hello Carlos,

Thank you for pointing this out. After all this time I haven't stumbled upon this problem and I still cannot say why some dependencies lack a version. So in the end I used the solution you provided to fix the issue. Sorry for taking so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment