You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/05/22 23:33:40 UTC

[maven] 03/03: [MNG-6819] Fix also NPE in StringSearchModelInterpolator

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-6819-2
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 5c77cc55c210a582e445931a1c2a739104778f39
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat May 23 01:30:47 2020 +0200

    [MNG-6819] Fix also NPE in StringSearchModelInterpolator
---
 .../maven/model/interpolation/StringSearchModelInterpolator.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
index af4d105..93e53b7 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
@@ -365,7 +365,7 @@ public class StringSearchModelInterpolator
 
                 String interpolated = ctx.interpolate( value );
 
-                if ( !interpolated.equals( value ) )
+                if ( interpolated != null && !interpolated.equals( value ) )
                 {
                     field.set( target, interpolated );
                 }
@@ -459,7 +459,7 @@ public class StringSearchModelInterpolator
                     {
                         String interpolated = ctx.interpolate( (String) value );
 
-                        if ( !interpolated.equals( value ) )
+                        if ( interpolated != null && !interpolated.equals( value ) )
                         {
                             try
                             {