[ 
https://issues.apache.org/jira/browse/ARTEMIS-3677?focusedWorklogId=724609&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-724609
 ]

ASF GitHub Bot logged work on ARTEMIS-3677:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Feb/22 16:45
            Start Date: 10/Feb/22 16:45
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on a change in pull request #3948:
URL: https://github.com/apache/activemq-artemis/pull/3948#discussion_r803878296



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
##########
@@ -876,7 +875,7 @@ public final void receiveBuffer(ByteBuf buffer) {
                // keep fields like _AMQ_ACTUAL_EXPIRY in their original type
                map.put(extraPropertiesPrefix + s.toString(), o);
             } else {
-               map.put(extraPropertiesPrefix + s.toString(), 
JsonUtil.truncate(o.toString(), valueSizeLimit));
+               map.put(extraPropertiesPrefix + s.toString(), 
JsonUtil.truncate(o != null ? o.toString() : o, valueSizeLimit));

Review comment:
       With the comment about wanting to keep original types, its not clear to 
me why it wouldnt just put the null in. Or omit it.

##########
File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java
##########
@@ -338,6 +338,9 @@ public static String truncateString(final String str, final 
int valueSizeLimit)
    }
 
    public static Object truncate(final Object value, final int valueSizeLimit) 
{
+      if (value == null) {
+         return "";

Review comment:
       Doesnt necessarily follow to me that the truncation of a null is an 
empty string. Why not return null? Or throw?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 724609)
    Time Spent: 20m  (was: 10m)

> Mitigate NPE when browsing messages
> -----------------------------------
>
>                 Key: ARTEMIS-3677
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3677
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>             Fix For: 2.21.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to