The current code lets a 'null' leak to a File() constructor, giving Null
pointer exception instead of the intended, clearer message.
Suggested fix:
diff -r b6400c384b64 project/build.scala
--- a/project/build.scala Sat Jan 19 19:20:04 2013 +0200
+++ b/project/build.scala Sat Jan 19 20:16:30 2013 +0200
@@ -29,11 +34,19 @@
var j = System.getenv("JAVAFX_HOME")
if ( j==null ) {
j = System.getenv("JAVA_HOME")
+ if (j==null) {
+ throw new RuntimeException(
+ "SBT Failure: neither JAVAFX_HOME nor JAVA_HOME environment
variables have been defined!"
+ )
+ }
}
val dir = new File(j)
if ( !dir.exists) {
- throw new RuntimeException(
- "SBT Failure: neither JAVAFX_HOME nor JAVA_HOME environment
variables have been defined!")
+ throw new RuntimeException("SBT Failure: no such dir: "+ j)
}
println("**** detected Java/JDK Home is set to "+dir+" ****")
Some(j)
Original issue reported on code.google.com by akau...@gmail.com on 19 Jan 2013 at 6:20
Original issue reported on code.google.com by
akau...@gmail.com
on 19 Jan 2013 at 6:20