New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE in JBossClassLoaderHandler#findClasspathOrder #651
Comments
arthware
pushed a commit
to actico/classgraph
that referenced
this issue
Feb 15, 2022
arthware
pushed a commit
to actico/classgraph
that referenced
this issue
Feb 16, 2022
lukehutch
added a commit
that referenced
this issue
Feb 17, 2022
#651 fixes NPE in JbossClassLoaderHandler
Fixed via #652. Thank you! |
Thank you for merging and your efforts! |
@lukehutch any chance to get a release pushed out in the next two weeks? That'd be awesome. Thank you very much! |
Yes, I'm sorry for the delay. I will do it in a few hours once my current flight lands! |
OK, I was able to push out version 4.8.140 with this fix. I probably should have just done this after merging. Thanks again for your fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In our scenario we get a
NullPointerException
inJBossClassLoaderHandler#findClasspathOrder
The
moduleMap
is null in our case, leading to an NPE in the next line, when accessing the entrySet.classgraph/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java
Lines 213 to 215 in f874380
I was able to fix this with a simple null check. The scan returns the expected results.
Before:
for (final Entry<Object, Object> ent : moduleMap.entrySet() ) {
After:
Set<Entry<Object, Object>> moduleMapEntries = moduleMap != null ? moduleMap.entrySet() : Collections.emptySet(); for (final Entry<Object, Object> ent : moduleMapEntries) {
The text was updated successfully, but these errors were encountered: