Skip to content

Commit

Permalink
Cherry pick #10254 for 1.32 patch release (#10274)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Kvasnytskyi <roman@kvasnytskyi.net>
  • Loading branch information
laurit and Periecle committed Jan 23, 2024
1 parent c30f9d8 commit 9d246ad
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 9d246ad

Please sign in to comment.