Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanuel Graf2009-11-24 02:16:01 -0500
committerEmanuel Graf2009-11-24 02:16:01 -0500
commit4876461e511b91405a5838e577d2272416dfb18a (patch)
tree2b222b4b0cf3d1fd0b6d6f806b0f6fe4fcc1c5a9 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter
parent252f33f0cdf9a1107bebf22781149177d91b7c53 (diff)
downloadorg.eclipse.cdt-4876461e511b91405a5838e577d2272416dfb18a.tar.gz
org.eclipse.cdt-4876461e511b91405a5838e577d2272416dfb18a.tar.xz
org.eclipse.cdt-4876461e511b91405a5838e577d2272416dfb18a.zip
Fix for NPE
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java
index 22b013232f..4acc51561c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ASTWriter.java
@@ -78,7 +78,9 @@ public class ASTWriter {
*/
public String write(IASTNode rootNode, String fileScope, NodeCommentMap commentMap) throws ProblemRuntimeException {
transformationVisitor = new ChangeGeneratorWriterVisitor(modificationStore, givenIndentation, fileScope, commentMap);
- rootNode.accept(transformationVisitor);
+ if(rootNode != null){
+ rootNode.accept(transformationVisitor);
+ }
String str = transformationVisitor.toString();
transformationVisitor.cleanCache();
return str;

Back to the top