You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2016/09/24 15:13:30 UTC
[09/40] maven git commit: [MNG-6053] prevent NPE when copying System
Properties in MavenRepositorySystemUtils
[MNG-6053] prevent NPE when copying System Properties in MavenRepositorySystemUtils
Signed-off-by: Fred Bricon <fb...@gmail.com>
This closes #90
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3d111735
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3d111735
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3d111735
Branch: refs/heads/MNG-6012-Missing-Profile-At-End
Commit: 3d111735310c4630d6e805ca8cd3916afcf66802
Parents: 6d9ffe3
Author: Fred Bricon <fb...@gmail.com>
Authored: Mon Jul 25 19:15:30 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Mon Jul 25 19:44:45 2016 +0200
----------------------------------------------------------------------
.../maven/repository/internal/MavenRepositorySystemUtils.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/3d111735/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
----------------------------------------------------------------------
diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
index 3a98b2a..17cbc6d 100644
--- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
+++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
@@ -131,7 +131,12 @@ public final class MavenRepositorySystemUtils
Properties sysProps = new Properties();
for ( String key : System.getProperties().stringPropertyNames() )
{
- sysProps.put( key, System.getProperty( key ) );
+ Object value = System.getProperty( key );
+ // MNG-6053 guard against key without value
+ if ( value != null )
+ {
+ sysProps.put( key, value );
+ }
}
session.setSystemProperties( sysProps );
session.setConfigProperties( sysProps );