Skip to content

Commit

Permalink
Fix #3092 - Add a null check to codeSource location
Browse files Browse the repository at this point in the history
  • Loading branch information
madninjaskillz committed Mar 1, 2021
1 parent 25bd304 commit 6a19c8e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ public static String getLocationOnDisk(Class<?> aClass) {
return null;
}
CodeSource codeSource = protectionDomain.getCodeSource();
if (codeSource == null) {

if (codeSource == null || codeSource.getLocation() == null) {
//Custom classloader with for example classes defined using URLClassLoader#defineClass(String name, byte[] b, int off, int len)
return null;
}
Expand Down

0 comments on commit 6a19c8e

Please sign in to comment.