[ 
https://issues.apache.org/jira/browse/CAMEL-9862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15239082#comment-15239082
 ] 

ASF GitHub Bot commented on CAMEL-9862:
---------------------------------------

GitHub user jamesnetherton opened a pull request:

    https://github.com/apache/camel/pull/943

    [CAMEL-9862] Fix potential NPE in UndertowComponent.unregisterConsumer

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jamesnetherton/camel CAMEL-9862

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/943.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #943
    
----
commit 6d0fd96ef197073cb345823bf7f5adb9d0a554df
Author: James Netherton <[email protected]>
Date:   2016-04-13T10:48:11Z

    [CAMEL-9862] Fix potential NPE in UndertowComponent.unregisterConsumer

----


> 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
>            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