From 1711cb6b876fd6ce55d0ed65ebeee5c120e2b1da Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Fri, 16 Feb 2024 10:43:18 -0500 Subject: [PATCH] Fix crash upon increasing TypedArray size Needed after upstream patch: https://github.com/godotengine/godot/commit/db7175458a0532f1efe733f303ad2b55a02a52a5 --- editor/editor_property_bb_param.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/editor_property_bb_param.cpp b/editor/editor_property_bb_param.cpp index 85aea1a..8927a15 100644 --- a/editor/editor_property_bb_param.cpp +++ b/editor/editor_property_bb_param.cpp @@ -270,6 +270,11 @@ void EditorPropertyBBParam::_variable_edited(const String &p_property, Variant p } void EditorPropertyBBParam::update_property() { + if (mode_button->get_mode() == -1) { + // Initialize UI -- needed after https://github.com/godotengine/godot/commit/db7175458a0532f1efe733f303ad2b55a02a52a5 + _notification(NOTIFICATION_THEME_CHANGED); + } + Ref param = _get_edited_param(); bool is_variant_param = param->is_class_ptr(BBVariant::get_class_ptr_static()); @@ -309,6 +314,11 @@ void EditorPropertyBBParam::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { + if (!get_edited_object()) { + // Null check needed after https://github.com/godotengine/godot/commit/db7175458a0532f1efe733f303ad2b55a02a52a5 + return; + } + { String type = Variant::get_type_name(_get_edited_param()->get_type()); type_choice->set_icon(get_editor_theme_icon(type));