Ah sorry, on this one though why not just change the previous line:

    val sparkHome = sys.env.get("SPARK_HOME").orElse(sys.props.get("spark.home"))