Skip to content

[Fixes #79][2.4.x] NPE hides outer exception#80

Merged
aaime merged 2 commits into
mapfish:2.4.xfrom
etj:48_24x
Jun 15, 2026
Merged

[Fixes #79][2.4.x] NPE hides outer exception#80
aaime merged 2 commits into
mapfish:2.4.xfrom
etj:48_24x

Conversation

@etj

@etj etj commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

See #79

Copilot AI review requested due to automatic review settings June 11, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +204 to +206
if(tempFileMetadata != null) {
deleteFile(tempFileMetadata.tempFile);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aaime left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks ok, two minor issues reported below.

Comment on lines +204 to +206
if(tempFileMetadata != null) {
deleteFile(tempFileMetadata.tempFile);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

aaime commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Btw, not targeting master? Is the issue not present there?

@etj

etj commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Btw, not targeting master? Is the issue not present there?

Here #82

@etj etj changed the title [Fixes #79] NPE hides outer exception [Fixes #79][2.4.x] NPE hides outer exception Jun 15, 2026
@etj

etj commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

#80 (comment)
| A simila issue is also present in createAndGetPDF, you might want to fix that one too... or not, up to you.

In createAndGetPDF the error may happen only in the finally block, no data or logging is messed up.

@aaime aaime merged commit b76cd0a into mapfish:2.4.x Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants