diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-06-10 16:21:17 +0100 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-06-10 16:21:17 +0100 |
commit | 44af2613da02497df06c9cba74f4605340ab3077 (patch) | |
tree | 1166d2684cc2b6245e55cc6839697f7533045120 /src/main | |
parent | 191c281ceb8290bbbc6b92bc8fe697aed055d988 (diff) | |
download | buildtools-44af2613da02497df06c9cba74f4605340ab3077.tar buildtools-44af2613da02497df06c9cba74f4605340ab3077.tar.gz buildtools-44af2613da02497df06c9cba74f4605340ab3077.tar.lz buildtools-44af2613da02497df06c9cba74f4605340ab3077.tar.xz buildtools-44af2613da02497df06c9cba74f4605340ab3077.zip |
Fix a null pointer issue with getenv
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/spigotmc/builder/Builder.java | 5 |
1 files 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" ); |