File tree Expand file tree Collapse file tree
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ public static Optional<Boolean> isVersionFromDefaultLifecycleBindings(InputLocat
8181 }
8282
8383 String modelId = versionLocation .getSource ().getModelId ();
84+ if (modelId == null ) {
85+ return Optional .empty ();
86+ }
8487 return Optional .of (
8588 modelId .startsWith ("org.apache.maven:maven-core:" ) && modelId .endsWith (":default-lifecycle-bindings" ));
8689 }
@@ -100,6 +103,9 @@ public static Optional<Boolean> isVersionFromSuperpom(InputLocationTracker o) {
100103 }
101104
102105 String modelId = versionLocation .getSource ().getModelId ();
106+ if (modelId == null ) {
107+ return Optional .empty ();
108+ }
103109 return Optional .of (
104110 modelId .startsWith ("org.apache.maven:maven-model-builder:" ) && modelId .endsWith (":super-pom" ));
105111 }
You can’t perform that action at this time.
0 commit comments