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

This commit is contained in:
Roel Spilker committed 2009-11-27 02:38:55 +01:00
1 parent e5d248c3cc
commit 86ac271a45
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);