Skip to content

fix(widget): get_parent returns pointer instead of reference - #49

Merged
Aintdev merged 1 commit into
masterfrom
fix/widget-get-parent-root
Sep 14, 2026
Merged

Aintdev merged 1 commit into
masterfrom
fix/widget-get-parent-root

Conversation

@Aintdev

@Aintdev Aintdev commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Closes #24

this makes it more safe if, for example: _parent == nullptr because nullptr would've been derefrenced.

Widget::get_parent() didnt have usages yet so no calls were changed.

this makes it more safe if, for example: _parent == nullptr because nullptr would've been derefrenced.
Copilot AI lite review requested due to automatic review settings September 14, 2026 15:19
@Aintdev Aintdev linked an issue Sep 14, 2026 that may be closed by this pull request

Copilot AI left a comment

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.

🟢 Approval recommended

No unresolved review issues remain.

Pull request overview

Updates Widget::get_parent() to return a nullable pointer, safely supporting root widgets without parents.

Changes:

  • Changes the return type from reference to pointer.
  • Returns _parent directly.
File summaries
File Summary
Source/Widgets/ctui_widget.h Updates the public API return type.
Source/Widgets/ctui_widget.cpp Returns the nullable parent pointer safely.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Aintdev
Aintdev merged commit 431b8ea into master Sep 14, 2026
1 check passed
@Aintdev
Aintdev deleted the fix/widget-get-parent-root branch September 14, 2026 15:45
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.

Widget::get_parent() dereferences nullptr for the root Screen

2 participants