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

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

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



##########
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:
       This method is used to deal with message data which is sent back to the 
web console for visual inspection. Given that it didn't handle `null` property 
values properly means that the web console wasn't actually getting any `null` 
property values either so it wasn't clear to me that it could actually handle 
them. I didn't want to fix this NPE only to create another one somewhere else.
   
   Also, there was a precedent for using a blank string for a `null` value 
already in 
`org.apache.activemq.artemis.core.message.impl.CoreMessage.TextMessageOpenTypeFactory#getFields`.
 I decided to carry that behavior forward here.




-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 724643)
    Time Spent: 0.5h  (was: 20m)

> 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: 0.5h
>  Remaining Estimate: 0h
>




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

Reply via email to