From 4c6c0fe2db5c7526da0e58443677c14a263e3d8f Mon Sep 17 00:00:00 2001 From: Laurent Belmonte Date: Sat, 4 Oct 2014 10:43:05 +0200 Subject: [PATCH] Fix: nullpointer on raw compilation --- src/org/plovr/Compilation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/plovr/Compilation.java b/src/org/plovr/Compilation.java index aaa9785921..0ad3576c4e 100644 --- a/src/org/plovr/Compilation.java +++ b/src/org/plovr/Compilation.java @@ -23,10 +23,13 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import com.google.javascript.jscomp.CheckLevel; import com.google.javascript.jscomp.Compiler; +import com.google.javascript.jscomp.ErrorManager; import com.google.javascript.jscomp.JSError; import com.google.javascript.jscomp.JSModule; import com.google.javascript.jscomp.PlovrCompilerOptions; +import com.google.javascript.jscomp.PrintStreamErrorManager; import com.google.javascript.jscomp.Result; import com.google.javascript.jscomp.SourceExcerptProvider; import com.google.javascript.jscomp.SourceFile; @@ -110,7 +113,9 @@ private void compileRaw(Config config) { // Need to have a dummy Result that appears to be a success (i.e., has no // errors or warnings). - this.result = new Compiler().getResult(); + Compiler dummyCompiler = new Compiler(); + dummyCompiler.setErrorManager(new PrintStreamErrorManager(System.out)); + this.result = dummyCompiler.getResult(); } /**