From 6d4632c681b3acd2415c05188af49fa6486c0d89 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Wed, 15 Aug 2012 16:08:23 +0400 Subject: [PATCH] Fixed NPE in version comparator inside PyRequirement --- .../src/com/jetbrains/python/packaging/PyRequirement.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java b/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java index 95462203829a..3d9b561b1769 100644 --- a/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java +++ b/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java @@ -161,6 +161,9 @@ public class PyRequirement { @NotNull private List 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 results = new ArrayList(); final Matcher matcher = COMPONENT_RE.matcher(s);