Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.16.3, 2.17.0
-
Component/s: camel-undertow
-
Labels:None
-
Estimated Complexity: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.