Skip to content

Commit 99a2a08

Browse files
committed
fix: NPE
1 parent 4747797 commit 99a2a08

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

generator/src/main/java/com/reajason/javaweb/memshell/injector/jetty/JettyFilterInjector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ public void inject(Object context, Object filter) throws Exception {
121121

122122
Object[] mappings = (Object[]) invokeMethod(servletHandler, "getFilterMappings");
123123
Object[] newMappings = null;
124-
int length = Array.getLength(mappings);
125-
if (mappings == null || length == 0) {
124+
if (mappings == null || Array.getLength(mappings) == 0) {
126125
newMappings = (Object[]) Array.newInstance(filterMappingClass, 1);
127126
} else {
127+
int length = Array.getLength(mappings);
128128
newMappings = (Object[]) Array.newInstance(filterMappingClass, length + 1);
129129
System.arraycopy(mappings, 0, newMappings, 1, length);
130130
}

0 commit comments

Comments
 (0)