Skip to content

Commit edf954f

Browse files
committed
SI-9226 Fix NPE in GenASM.writeIfNotTooBig
On 2.11.6 line 535 (as reported in the issue) points to the changed line. Exception.getMessage can return null. Checking for null on the matched variable is not necessary. No tests, because I have no idea on how to reproduce the problem.
1 parent fa33395 commit edf954f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
533533
}
534534
bytecodeWriter.writeClass(label, jclassName, arr, outF)
535535
} catch {
536-
case e: java.lang.RuntimeException if e != null && (e.getMessage contains "too large!") =>
536+
case e: java.lang.RuntimeException if e.getMessage != null && (e.getMessage contains "too large!") =>
537537
reporter.error(sym.pos,
538538
s"Could not write class $jclassName because it exceeds JVM code size limits. ${e.getMessage}")
539539
}

0 commit comments

Comments
 (0)