Skip to content

Commit

Permalink
Merge pull request #11511 from jetty/fix/12.0.x/classmatcher-match-npe
Browse files Browse the repository at this point in the history
Issue #11510 - Prevent NPE in ClassMatcher.match()
  • Loading branch information
joakime authored Mar 13, 2024
2 parents c05ae3b + c2d0ab2 commit d07d13f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ public boolean match(Class<?> clazz)

public boolean match(String name, URL url)
{
if (url == null)
return false;

// Strip class suffix for name matching
if (name.endsWith(".class"))
name = name.substring(0, name.length() - 6);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ public boolean match(Class<?> clazz)

public boolean match(String name, URL url)
{
if (url == null)
return false;

// Strip class suffix for name matching
if (name.endsWith(".class"))
name = name.substring(0, name.length() - 6);
Expand Down

0 comments on commit d07d13f

Please sign in to comment.