From b3fa8870f82f01cd00cc31dafd81f3b6ea86b140 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Wed, 14 Feb 2024 20:58:21 +0200 Subject: [PATCH] Fix null instance error causing a crash on startup, originating from #974 --- src/UI/ReferenceImages/ReferencesPanel.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UI/ReferenceImages/ReferencesPanel.gd b/src/UI/ReferenceImages/ReferencesPanel.gd index 5fc7a4c88..b944426ca 100644 --- a/src/UI/ReferenceImages/ReferencesPanel.gd +++ b/src/UI/ReferenceImages/ReferencesPanel.gd @@ -132,7 +132,8 @@ func _on_reference_image_changed(index: int) -> void: # NOTE: using list_btn_group.get_buttons()[index + 1] here was causing a bug that # if you re-arrange by drag and drop, then click on a button, then button before it # becomes selected instead of the clicked button - list.get_child(index + 1).set_pressed_no_signal(true) + if index + 1 < list.get_child_count(): + list.get_child(index + 1).set_pressed_no_signal(true) func project_changed() -> void: