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=refs%2Fpull%2F395%2Fhead;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); }