From 44af2613da02497df06c9cba74f4605340ab3077 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 10 Jun 2015 16:21:17 +0100 Subject: Fix a null pointer issue with getenv --- src/main/java/org/spigotmc/builder/Builder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java index 810cf3c..0549cd8 100644 --- a/src/main/java/org/spigotmc/builder/Builder.java +++ b/src/main/java/org/spigotmc/builder/Builder.java @@ -171,8 +171,9 @@ public class Builder clone( "https://hub.spigotmc.org/stash/scm/spigot/builddata.git", buildData ); } - File maven = new File( System.getenv( "M2_HOME" ) ); - if ( !maven.exists() ) + File maven; + String m2Home = System.getenv( "M2_HOME" ); + if ( m2Home == null || !(maven = new File(m2Home)).exists() ) { maven = new File( "apache-maven-3.2.5" ); -- cgit v1.2.3