Skip to content

Commit

Permalink
avoid NPE when HADOOP_HOME not set
Browse files Browse the repository at this point in the history
  • Loading branch information
jetoile committed May 15, 2016
1 parent 22000a3 commit 87afad5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public static void setHadoopHome() {
String hadoop_home = configuration.getString("HADOOP_HOME");

LOG.info("Setting hadoop.home.dir: {}", hadoop_home);
System.setProperty("HADOOP_HOME", hadoop_home);
if (hadoop_home == null) {
LOG.error("HADOOP_HOME should be set or informed into default.properties");
System.exit(-1);
} else {
System.setProperty("HADOOP_HOME", hadoop_home);
}

} else {
System.setProperty("HADOOP_HOME", System.getenv("HADOOP_HOME"));
Expand Down

0 comments on commit 87afad5

Please sign in to comment.