Skip to content

Avoid null pointer exception crashing the webapp.#956

Merged
tomas-sexenian merged 4 commits into
masterfrom
avoid-nullptr-close-smtp
Apr 2, 2025
Merged

Avoid null pointer exception crashing the webapp.#956
tomas-sexenian merged 4 commits into
masterfrom
avoid-nullptr-close-smtp

Conversation

@tomas-sexenian

Copy link
Copy Markdown
Contributor

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

This PR aims to prevent null pointer exceptions from crashing the webapp by adding a dedicated catch block in the logout method.

  • Added a catch block for NullPointerException in the logout method
  • Introduced an import for ObjectUtils (currently unused)

Comment on lines +242 to +246
}
catch (NullPointerException e)
{
log ("8 - NullPointerException " + e.getMessage());
sessionInfo.exceptionHandler(new GXMailException(e.getMessage(), MAIL_ConnectionLost));

Copilot AI Mar 26, 2025

Copy link

Choose a reason for hiding this comment

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

Catching NullPointerException can mask underlying issues; consider refactoring the code to perform explicit null checks to prevent the exception from occurring.

Suggested change
}
catch (NullPointerException e)
{
log ("8 - NullPointerException " + e.getMessage());
sessionInfo.exceptionHandler(new GXMailException(e.getMessage(), MAIL_ConnectionLost));

Copilot uses AI. Check for mistakes.
@genexusbot

Copy link
Copy Markdown
Collaborator
Cherry pick to beta success

@genexusbot

Copy link
Copy Markdown
Collaborator
Cherry pick to beta success

@genexusbot

Copy link
Copy Markdown
Collaborator
Cherry pick to beta success

@tomas-sexenian tomas-sexenian merged commit fdaefe9 into master Apr 2, 2025
@tomas-sexenian tomas-sexenian deleted the avoid-nullptr-close-smtp branch April 2, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants