-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix potential NPE in MmapByteBufferService #181
Conversation
Signed-off-by: Nicolas Rol <[email protected]>
} catch (Exception e) { | ||
LOGGER.trace(e.toString(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} catch (Exception e) { | |
LOGGER.trace(e.toString(), e); | |
} catch (IOException e) { | |
throw new UncheckedIOException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for the IOException but we don't want to throw an exception if we fail to delete the file, just log it and return false
Signed-off-by: Nicolas Rol <[email protected]>
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
* fix potential NPE Signed-off-by: Nicolas Rol <[email protected]> * back to catching IOException Signed-off-by: Nicolas Rol <[email protected]> --------- Signed-off-by: Nicolas Rol <[email protected]> (cherry picked from commit 21929f8)
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
In
MmapByteBufferService.tryToDelete()
,context.file
can be null, which will throw a NullPointerException when trying to delete the fileWhat is the new behavior (if this is a feature change)?
We now check first if
context.file
is null or notDoes this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: