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