-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JmsUtils.buildExceptionMessage throws NPE if the linked exception doesn't have a message [SPR-5275] #9948
Comments
Juergen Hoeller commented Thanks for pointing this out! Juergen |
Guillaume Nodet commented JmsException.getMessage() can also throw an NPE if the linked exception has no message. |
Guillaume Nodet commented The current code will throw an NPE if
|
Karim Qazi commented Looking at the 3.0M1 code this isn't totally fixed. Here is the code I see in the 3.0M1 code base:
A null check for "linkedEx.getMessage()" needs to happen or else a NPE can still occur in "!message.contains(linkedEx.getMessage())". This is coded like "someString".equals(null) which will not throw a NPE, but "someString".contains(null) will throw a NPE. |
Juergen Hoeller commented Karim, That additional not-null check is indeed necessary. Fortunately, it's in there since 3.0 M2 already. Juergen |
Karim Qazi commented Ok thanks. When is 3.0 scheduled for release? |
Anders Wallgren opened SPR-5275 and commented
This method throws an exception if the linked exception's message is null. I've patched it locally as follow:
Affects: 2.5.6
Issue Links:
The text was updated successfully, but these errors were encountered: