[Fixes #79][2.4.x] NPE hides outer exception#80
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates PDF creation error handling to avoid throwing a secondary exception while processing failures, ensuring cleanup runs safely when temp metadata was not initialized.
Changes:
- Guard temp file deletion in the exception path with a null-check to prevent
NullPointerException.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(tempFileMetadata != null) { | ||
| deleteFile(tempFileMetadata.tempFile); | ||
| } |
There was a problem hiding this comment.
I second the small formatting issue.
A simila issue is also present in createAndGetPDF, you might want to fix that one too... or not, up to you.
aaime
left a comment
There was a problem hiding this comment.
Change looks ok, two minor issues reported below.
| if(tempFileMetadata != null) { | ||
| deleteFile(tempFileMetadata.tempFile); | ||
| } |
There was a problem hiding this comment.
I second the small formatting issue.
A simila issue is also present in createAndGetPDF, you might want to fix that one too... or not, up to you.
|
Btw, not targeting master? Is the issue not present there? |
Here #82 |
|
#80 (comment) In |
See #79