Fixed NPE in version comparator inside PyRequirement

This commit is contained in:
Andrey Vlasovskikh
2012-08-15 16:08:23 +04:00
parent 2d8dfc6cb1
commit 6d4632c681
@@ -161,6 +161,9 @@ public class PyRequirement {
@NotNull
private List<String> parse(@Nullable String s) {
// Version parsing from pkg_resources ensures that all the "pre", "alpha", "rc", etc. are sorted correctly
if (s == null) {
return Collections.emptyList();
}
final Pattern COMPONENT_RE = Pattern.compile("\\d+|[a-z]+|\\.|-|.+");
final List<String> results = new ArrayList<String>();
final Matcher matcher = COMPONENT_RE.matcher(s);