Skip to content

Commit 2b09e80

Browse files
committed
trivial bugfix Godot 4.4.1 version update
1 parent 85b4b2f commit 2b09e80

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Palette/Palette.gd

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ func deserialize_from_dictionary(data: Dictionary) -> void:
115115
comment = data.comment
116116
if data.has("colors"):
117117
for color_data in data.colors:
118-
var color: Color
119-
if typeof(color_data["color"]) == TYPE_STRING:
120-
color = str_to_var("Color" + color_data["color"])
121-
elif typeof(color_data["color"]) == TYPE_COLOR:
122-
color = color_data["color"]
123-
var index := color_data["index"] as int
124-
var palette_color := PaletteColor.new(color, index)
125-
colors[index] = palette_color
118+
if color_data.has("color") and color_data.has("index"):
119+
var color: Color
120+
if typeof(color_data["color"]) == TYPE_STRING:
121+
color = str_to_var("Color" + color_data["color"])
122+
elif typeof(color_data["color"]) == TYPE_COLOR:
123+
color = color_data["color"]
124+
var index := color_data["index"] as int
125+
var palette_color := PaletteColor.new(color, index)
126+
colors[index] = palette_color
126127
if data.has("width"):
127128
width = data.width
128129
if data.has("height"):

0 commit comments

Comments
 (0)