Skip to content
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

Error when typing in the script editor after text search #81441

Closed
gokiburikin opened this issue Sep 8, 2023 · 1 comment · Fixed by #81450
Closed

Error when typing in the script editor after text search #81441

gokiburikin opened this issue Sep 8, 2023 · 1 comment · Fixed by #81450

Comments

@gokiburikin
Copy link

Godot version

v4.2.dev4.official [549fcce]

System information

Windows 10

Issue description

scene/main/node.cpp:1757 - Parameter "p_node" is null. when attempting to type after using find function. Does not happen in 4.2dev3.

b80c187d087a7267636baeb8c7625b36.mp4

Steps to reproduce

  1. Open any script in the script editor
  2. Ctrl+F to select some text that exists in the script
  3. Hit escape to re-focus the script editor without placing the caret
  4. Attempt to type

Minimal reproduction project

find-mrp.zip

@jsjtxietian
Copy link
Contributor

jsjtxietian commented Sep 8, 2023

Looks like get_viewport()->gui_get_focus_owner() is null after hitting escape, so it passed null to is_ancestor_of.

if ((find_replace_bar != nullptr && find_replace_bar->is_visible()) && (find_replace_bar->has_focus() || find_replace_bar->is_ancestor_of(get_viewport()->gui_get_focus_owner()))) {
if (ED_IS_SHORTCUT("script_text_editor/find_next", key_event)) {
find_replace_bar->search_next();
accept_event();
return;
}

@KoBeWi It's because the e21c30e made the search box ( which is a lineEdit ) lose focus when input is ui_cancel.

Any suggestion how to fix this? Maybe make it the default behaviour and add some null protection, or we make it a special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants