Skip to content

Commit

Permalink
Merge pull request mvel#75 from objectiser/classloader
Browse files Browse the repository at this point in the history
Fix NPE when using mvel compiled expression from bootstrap classloader
  • Loading branch information
mariofusco committed Jul 28, 2015
2 parents 053b19d + 3b1427a commit dbab7f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/mvel2/optimizers/OptimizerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public class OptimizerFactory {
* By default, activate the JIT if ASM is present in the classpath
*/
try {
OptimizerFactory.class.getClassLoader().loadClass("org.mvel2.asm.ClassWriter");
if (OptimizerFactory.class.getClassLoader() != null) {
OptimizerFactory.class.getClassLoader().loadClass("org.mvel2.asm.ClassWriter");
} else {
ClassLoader.getSystemClassLoader().loadClass("org.mvel2.asm.ClassWriter");
}
accessorCompilers.put("ASM", new ASMAccessorOptimizer());
}
catch (ClassNotFoundException e) {
Expand Down

0 comments on commit dbab7f0

Please sign in to comment.