Skip to content

Commit

Permalink
Add guards to catch null arguments in AsyncConnectionProvider.forEach…
Browse files Browse the repository at this point in the history
…(…) #1301
  • Loading branch information
mp911de committed Jun 8, 2020
1 parent 4f9d330 commit a076b77
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,14 @@ public void close(K key) {
* @param action the action.
*/
public void forEach(Consumer<? super T> action) {
connections.values().forEach(sync -> sync.doWithConnection(action));

LettuceAssert.notNull(action, "Action must not be null!");

connections.values().forEach(sync -> {
if (sync != null) {
sync.doWithConnection(action);
}
});
}

/**
Expand Down

0 comments on commit a076b77

Please sign in to comment.