Skip to content

Avoid null pointer exception crashing the webapp. #956

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

Merged
merged 4 commits into from
Apr 2, 2025

Conversation

tomas-sexenian
Copy link
Contributor

Copy link

@Copilot Copilot AI left a comment

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));
Copy link
Preview

Copilot AI Mar 26, 2025

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
Collaborator

Cherry pick to beta success

@genexusbot
Copy link
Collaborator

Cherry pick to beta success

@genexusbot
Copy link
Collaborator

Cherry pick to beta success

@tomas-sexenian tomas-sexenian merged commit fdaefe9 into master Apr 2, 2025
10 checks passed
@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.

3 participants