[
https://issues.apache.org/jira/browse/ARTEMIS-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16629305#comment-16629305
]
ASF GitHub Bot commented on ARTEMIS-2098:
-----------------------------------------
Github user michaelandrepearce commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2334#discussion_r220697913
--- Diff:
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
---
@@ -196,6 +196,10 @@ protected void decode(ChannelHandlerContext ctx,
ByteBuf in, List<Object> out) t
}
ProtocolManager protocolManagerToUse =
protocolMap.get(protocolToUse);
+ if (protocolManagerToUse == null) {
+
ActiveMQServerLogger.LOGGER.failedToFindProtocolManager(ctx.channel().remoteAddress().toString(),
ctx.channel().localAddress().toString(), protocolToUse,
protocolMap.keySet().toString());
--- End diff --
Question, how sure/guarenteed is it that these objects will def be wont be
null them selves, aka doing this logger wont cause an NPE.
ctx.channel().remoteAddress().toString()
ctx.channel().localAddress().toString()
is it worth null checking the dot train?
e.g. is it worth doing?
ctx.channel() == null ? null : ctx.channel().localAddress() == null ? null
: ctx.channel().localAddress().toString
> Potential NPE when decoding protocol
> ------------------------------------
>
> Key: ARTEMIS-2098
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2098
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.6.3
> Reporter: Justin Bertram
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)