Skip to content

Issue #82: Prevent is react field null error#226

Open
sebastianbarrozo wants to merge 2 commits intomainfrom
hotfix/#82-ETP-3361
Open

Issue #82: Prevent is react field null error#226
sebastianbarrozo wants to merge 2 commits intomainfrom
hotfix/#82-ETP-3361

Conversation

@sebastianbarrozo
Copy link
Copy Markdown
Contributor

ETP-3361

@sonarscanetendo
Copy link
Copy Markdown

Copy link
Copy Markdown

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

Fixes Issue #82 by making the Projection bean resilient to null values coming from the model’s isReact() flag, preventing a null-unboxing error during entity/code generation.

Changes:

  • Add a null-safe check when reading projection.getModule().isReact() to populate the primitive react field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

this.projection = projection;
this.grpc = projection.isGrpc();
this.react = projection.getModule().isReact();
this.react = projection.getModule().isReact() != null && projection.getModule().isReact();
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

projection.getModule().isReact() is evaluated twice here. Consider reading it into a local variable or using Boolean.TRUE.equals(projection.getModule().isReact()) to both handle null safely and avoid duplicate calls, improving readability/maintainability.

Suggested change
this.react = projection.getModule().isReact() != null && projection.getModule().isReact();
this.react = Boolean.TRUE.equals(projection.getModule().isReact());

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

4 participants