diff options
author | Miles Sabin <miles@milessabin.com> | 2009-10-25 17:19:16 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-10-25 17:19:16 +0000 |
commit | 765acb478956976a6e5ebd466200f9c4f5a0e90a (patch) | |
tree | 4db202c4cd1e2e61e1391ff5cc8906f877f9f760 | |
parent | 93967d3563920996a80cc16ccf72dbe8660ca3cb (diff) | |
download | scala-765acb478956976a6e5ebd466200f9c4f5a0e90a.tar.gz scala-765acb478956976a6e5ebd466200f9c4f5a0e90a.tar.bz2 scala-765acb478956976a6e5ebd466200f9c4f5a0e90a.zip |
Suppression of a possible NPE which is almost c...
Suppression of a possible NPE which is almost certainly a side-effect of
an earlier error. This change is better than the status quo, but clearly
there's work to be done here.
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 8444065004..df26a832c7 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -84,7 +84,13 @@ self => if (typerRun == currentTyperRun) return - integrateNew() + // @Martin + // Guard against NPEs in integrateNew if context.unit == null here. + // But why are we doing this at all? If it was non-null previously + // integrateNew will already have been called. If it was null previously + // it will still be null now? + if (context.unit != null) + integrateNew() throw new FreshRunReq } catch { case ex : ValidateError => // Ignore, this will have been reported elsewhere |