godotengine / godotengine/godot
`ERROR: Parameter "data.tree" is null.` while `is_inside_tree()` is true.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.4.dev
### System information
Windows 10
### Issue description
Produced on a custom build.
Dumping the backtrace. Please include this when reporting the bug to the project developer.
couldn't map PC to fn name
.....

This shouldn't happen! The only explanation is that it was caused by removing a child `OptionButton` while it's popup is visible and `WINDOW_EVENT_MOUSE_EXIT` was called for the popup.

### Steps to reproduce
It will be hard to provide a MRP, I'm using a custom `Inspector` and i clear all the children then i readd them again when `property_list_changed` is called, just to hide/show a property based on it's "usage".
https://github.com/user-attachments/assets/7163ee04-1159-4dc2-a9f8-7a4df1f9fcbc
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start with the reported backtrace and the popup's WINDOW_EVENT_MOUSE_EXIT path, focusing on the case where a child OptionButton is removed while its popup is visible. Reproduce with the custom Inspector behavior described, then verify that the null Parameter "data.tree" error no longer occurs when the child controls are cleared and readded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100