From a5a74e99a336aeb621fb0f5701178fe1c41f764b Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:18:19 +0300 Subject: [PATCH] Fix crash when re-arranging palette swatches while holding Shift --- src/Palette/Palette.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Palette/Palette.gd b/src/Palette/Palette.gd index 80c97880c..3fda63a60 100644 --- a/src/Palette/Palette.gd +++ b/src/Palette/Palette.gd @@ -216,7 +216,7 @@ func insert_color(index: int, new_color: Color) -> void: var c := PaletteColor.new(new_color, index) # If insert happens on non empty swatch recursively move the original color # and every other color to its right one swatch to right - if colors[index] != null: + if colors.has(index): _move_right(index) colors[index] = c data_changed.emit() @@ -231,7 +231,7 @@ func _move_right(index: int) -> void: colors_max = width * height # If swatch to right to this color is not empty move that color right too - if colors[index + 1] != null: + if colors.has(index + 1): _move_right(index + 1) colors[index + 1] = colors[index]