File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -115,14 +115,15 @@ func deserialize_from_dictionary(data: Dictionary) -> void:
115
115
comment = data .comment
116
116
if data .has ("colors" ):
117
117
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
126
127
if data .has ("width" ):
127
128
width = data .width
128
129
if data .has ("height" ):
You can’t perform that action at this time.
0 commit comments