Skip to content

Commit db46241

Browse files
committed
Fix NPE in tests.
1 parent 0b6a190 commit db46241

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ class CodegenContext {
726726
// be extremely expensive in certain cases, such as deeply-nested expressions which operate over
727727
// inputs with wide schemas. For more details on the performance issues that motivated this
728728
// flat, see SPARK-15680.
729-
if (SparkEnv.get.conf.getBoolean("spark.sql.codegen.comments", false)) {
729+
if (SparkEnv.get != null && SparkEnv.get.conf.getBoolean("spark.sql.codegen.comments", false)) {
730730
val name = freshName("c")
731731
val comment = if (text.contains("\n") || text.contains("\r")) {
732732
text.split("(\r\n)|\r|\n").mkString("/**\n * ", "\n * ", "\n */")

0 commit comments

Comments
 (0)