Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.16.3, 2.17.0
-
None
-
Unknown
Description
There's a potential NPE in the UndertowComponent class when Undertow consumers are stopped. Here's a snippet from the unregisterConsumer method:
public void unregisterConsumer(UndertowConsumer consumer) { int port = consumer.getEndpoint().getHttpURI().getPort(); if (serversRegistry.containsKey(port)) { serversRegistry.get(port).unregisterConsumer(consumer); } if (serversRegistry.get(port).isEmpty()) { // stuff happens here } }
If serversRegistry.containsKey returns false for the given port, then we should not be proceeding to call methods like isEmpty afterwards.