]> source.dussan.org Git - javassist.git/commitdiff
Fix for NullPointerException on detach() 395/head
authorBurak Şahin <abrkshn95@gmail.com>
Tue, 21 Sep 2021 08:13:48 +0000 (11:13 +0300)
committerBurak Şahin <abrkshn95@gmail.com>
Tue, 21 Sep 2021 08:13:48 +0000 (11:13 +0300)
src/main/javassist/CtClass.java

index f227019f2e41bd07c71ede4a692146224b992b21..f1a4734267ced49bdb13ce1dc85dcf0d8903f05b 100644 (file)
@@ -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);
     }