Permalink
Browse files

Don't fail on empty version

  • Loading branch information...
1 parent bf1d780 commit a81ba03214e28af451cfa05dc7de8b291f75e5a4 @purcell purcell committed with Aug 8, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/leiningen/update_repo.clj
@@ -6,7 +6,7 @@
(def *lein-dir* (str (System/getProperty "user.home") "/.lein"))
(defn split-version [v]
- (if-let [[_ major minor patch suffix] (re-find #"(\d+)\.(\d+)(?:\.(\d+))?(?:-(.*))?" v)]
+ (if-let [[_ major minor patch suffix] (when v (re-find #"(\d+)\.(\d+)(?:\.(\d+))?(?:-(.*))?" v))]
[(Integer/parseInt major) (Integer/parseInt minor) (Integer/parseInt (or patch "0")) (or suffix "")]
[0 0 0 ""]))

0 comments on commit a81ba03

Please sign in to comment.