Merge pull request #30583 from hbina/fix_crash_issue_30493

Fix crashing when changing Node type.
This commit is contained in:
Rémi Verschelde 2019-07-15 16:41:55 +02:00 committed by GitHub
commit 5d962f8baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -394,7 +394,11 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (!profile_allow_editing) {
break;
}
create_dialog->popup_create(false, true, scene_tree->get_selected()->get_class());
Node *selected = scene_tree->get_selected();
if (selected)
create_dialog->popup_create(false, true, selected->get_class());
} break;
case TOOL_ATTACH_SCRIPT: {