Skip to content

Commit

Permalink
Merge pull request #395 from aburaksahin/master
Browse files Browse the repository at this point in the history
Fix for NullPointerException on detach()
  • Loading branch information
chibash committed Sep 21, 2021
2 parents 047f7c7 + 0181698 commit 52629ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/javassist/CtClass.java
Expand Up @@ -1423,7 +1423,7 @@ public final Class<?> toClass(ClassLoader loader)
public void detach() {
ClassPool cp = getClassPool();
CtClass obj = cp.removeCached(getName());
if (obj != this)
if (obj != null && obj != this)
cp.cacheCtClass(getName(), obj, false);
}

Expand Down

0 comments on commit 52629ee

Please sign in to comment.