Skip to content

Commit

Permalink
Fixed "missing" listeners on addListeners method in Netty instrumenta…
Browse files Browse the repository at this point in the history
…tion. Add null check validation for Netty listener advice apply
  • Loading branch information
Periecle committed Jan 17, 2024
1 parent 7f7989a commit 9d8e7c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected Boolean computeValue(Class<?> type) {
};

public static boolean shouldWrap(GenericFutureListener<? extends Future<?>> listener) {
return shouldWrap.get(listener.getClass());
return listener != null && shouldWrap.get(listener.getClass());
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public static void wrapListener(
for (int i = 0; i < listeners.length; ++i) {
if (FutureListenerWrappers.shouldWrap(listeners[i])) {
wrappedListeners[i] = FutureListenerWrappers.wrap(context, listeners[i]);
} else {
wrappedListeners[i] = listeners[i];
}
}
listeners = wrappedListeners;
Expand Down

0 comments on commit 9d8e7c3

Please sign in to comment.