Skip to content

Commit e05d58d

Browse files
committed
fix: custom shell NPE
1 parent 0c041ee commit e05d58d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generator/src/main/java/com/reajason/javaweb/memshell/generator/ListenerGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static DynamicType.Builder<?> build(DynamicType.Builder<?> builder, Class
2424
"getResponseFromRequest", newClassName, ShellCommonUtil.class.getName()))
2525
.visit(Advice.to(implInterceptor).on(named("getResponseFromRequest")));
2626

27-
boolean methodNotFound = TypeDescription.ForLoadedType.of(targetClass)
27+
boolean methodNotFound = targetClass != null && TypeDescription.ForLoadedType.of(targetClass)
2828
.getDeclaredMethods()
2929
.filter(named("getFieldValue")
3030
.and(takesArguments(Object.class, String.class)))

0 commit comments

Comments
 (0)