From 018169818c4ed96d3095f52c588b439510c1b288 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Burak=20=C5=9Eahin?= Date: Tue, 21 Sep 2021 11:13:48 +0300 Subject: [PATCH] Fix for NullPointerException on detach() --- src/main/javassist/CtClass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java index f227019f..f1a47342 100644 --- a/src/main/javassist/CtClass.java +++ b/src/main/javassist/CtClass.java @@ -1423,7 +1423,7 @@ public abstract class CtClass { public void detach() { ClassPool cp = getClassPool(); CtClass obj = cp.removeCached(getName()); - if (obj != this) + if (obj != null && obj != this) cp.cacheCtClass(getName(), obj, false); } -- 2.39.5