mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 20:17:25 +00:00
We encountered a strange NPE here. Can't reproduce, nevertheless added null-checks
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user