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);