Merge pull request #41 from Rubonnek/fix-typed-array-crash

Fix crash upon increasing TypedArray<BBVariant> size
This commit is contained in:
Serhii Snitsaruk 2024-02-16 17:58:40 +01:00 committed by GitHub
commit 38409d45f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -270,6 +270,11 @@ void EditorPropertyBBParam::_variable_edited(const String &p_property, Variant p
} }
void EditorPropertyBBParam::update_property() { 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<BBParam> param = _get_edited_param(); Ref<BBParam> param = _get_edited_param();
bool is_variant_param = param->is_class_ptr(BBVariant::get_class_ptr_static()); 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) { switch (p_what) {
case NOTIFICATION_ENTER_TREE: case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: { 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()); String type = Variant::get_type_name(_get_edited_param()->get_type());
type_choice->set_icon(get_editor_theme_icon(type)); type_choice->set_icon(get_editor_theme_icon(type));