We encountered a strange NPE here. Can't reproduce, nevertheless added null-checks

This commit is contained in:
Roel Spilker authored and Reinier Zwitserloot committed 2009-11-27 02:43:37 +01:00
1 parent 1a0e611a9c
commit 6838c6be2f
1 file changed
+1
@@ -26,6 +26,7 @@ public class PatchFixes {
public static void setIsGeneratedFlag(org.eclipse.jdt.core.dom.ASTNode domNode,
org.eclipse.jdt.internal.compiler.ast.ASTNode internalNode) throws Exception {
if (internalNode == null || domNode == null) return;
boolean isGenerated = internalNode.getClass().getField("$generatedBy").get(internalNode) != null;
if (isGenerated) {
domNode.getClass().getField("$isGenerated").set(domNode, true);