From: Burak Şahin Date: Tue, 21 Sep 2021 08:13:48 +0000 (+0300) Subject: Fix for NullPointerException on detach() X-Git-Tag: rel_3_29_0_ga~18^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=018169818c4ed96d3095f52c588b439510c1b288;p=javassist.git Fix for NullPointerException on detach() --- 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); }