summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Schäfer <mail@antoras.de>2015-03-16 08:11:48 +0100
committerSimon Schäfer <mail@antoras.de>2015-03-16 08:17:56 +0100
commitedf954ff10b0f1fb7668018d43680646f8503b27 (patch)
treeec13b8f0167e2f3cec0fa31f43496b951172d3ff /src
parentfa33395a25c87115c910e8d4a4124aee6134062b (diff)
downloadscala-edf954ff10b0f1fb7668018d43680646f8503b27.tar.gz
scala-edf954ff10b0f1fb7668018d43680646f8503b27.tar.bz2
scala-edf954ff10b0f1fb7668018d43680646f8503b27.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
index 62268e1907..86a69b92ea 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -533,7 +533,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
}
bytecodeWriter.writeClass(label, jclassName, arr, outF)
} catch {
- case e: java.lang.RuntimeException if e != null && (e.getMessage contains "too large!") =>
+ case e: java.lang.RuntimeException if e.getMessage != null && (e.getMessage contains "too large!") =>
reporter.error(sym.pos,
s"Could not write class $jclassName because it exceeds JVM code size limits. ${e.getMessage}")
}