[ 
https://issues.apache.org/jira/browse/CAMEL-9862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-9862.
--------------------------------
    Resolution: Fixed
      Assignee: Claus Ibsen

Thanks for the PR

> Potential NPE in UndertowComponent.unregisterConsumer
> -----------------------------------------------------
>
>                 Key: CAMEL-9862
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9862
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-undertow
>    Affects Versions: 2.16.3, 2.17.0
>            Reporter: James Netherton
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.16.4, 2.17.1, 2.18.0
>
>
> There's a potential NPE in the UndertowComponent class when Undertow 
> consumers are stopped. Here's a snippet from the unregisterConsumer method:
> {code}
>     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
>         }
>     }
> {code}
> If serversRegistry.containsKey returns false for the given port, then we 
> should not be proceeding to call methods like isEmpty afterwards.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to