From 5f53a3eb7b156c5ab5bebe2e627e240c784ba9cd Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 23 Nov 2024 14:17:27 +0200 Subject: [PATCH] Fix crash when Pixelorama starts without a palette --- src/Palette/PaletteGrid.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Palette/PaletteGrid.gd b/src/Palette/PaletteGrid.gd index bc5c5a410..ffc80527e 100644 --- a/src/Palette/PaletteGrid.gd +++ b/src/Palette/PaletteGrid.gd @@ -87,6 +87,8 @@ func scroll_palette(origin: Vector2i) -> void: ## Called when the color changes, either the left or the right, determined by [param mouse_button]. ## If current palette has [param target_color] as a [Color], then select it. func find_and_select_color(target_color: Color, mouse_button: int) -> void: + if not is_instance_valid(current_palette): + return var old_index := Palettes.current_palette_get_selected_color_index(mouse_button) for color_ind in swatches.size(): if (