davidnadeau opened a new issue, #1761:
URL: https://github.com/apache/fury/issues/1761

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/fury/issues) 
and found no similar issues.
   
   
   ### Version
   
   0.6.0
   
   ### Component(s)
   
   Java
   
   ### Minimal reproduce step
   
   Pass in a null msg, and the logger will fail to log the error message and 
instead print:
   
   ```
   j.l.NullPointerException: Cannot invoke "String.length()" because "msg" is 
null
        at o.a.f.l.FuryLogger.log(FuryLogger.java:145)
        at o.a.f.l.FuryLogger.error(FuryLogger.java:133)
   ```
   
   The null pointer is caused by this line: 
https://github.com/apache/fury/blob/releases-0.6/java/fury-core/src/main/java/org/apache/fury/logging/FuryLogger.java#L145.
 We should first check that the msg is not null, before trying to get its 
length.
   
   ### What did you expect to see?
   
   I expect the stack trace to print, even when the msg is null.
   
   ### What did you see instead?
   
   the actual error is not printed, instead we get a null pointer printed, this 
makes debugging the actual error more difficult.
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to