mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:19:04 +08:00
Correctly handle IndexError for defaultColors
CURA-4072 defaultColors is a list, so it's not KeyError but IndexError.
This commit is contained in:
parent
d7f3553c90
commit
3aabbab11f
@ -177,7 +177,7 @@ class ProcessSlicedLayersJob(Job):
|
|||||||
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position
|
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position
|
||||||
try:
|
try:
|
||||||
default_color = ExtrudersModel.defaultColors[position]
|
default_color = ExtrudersModel.defaultColors[position]
|
||||||
except KeyError:
|
except IndexError:
|
||||||
default_color = "#e0e000"
|
default_color = "#e0e000"
|
||||||
color_code = extruder.material.getMetaDataEntry("color_code", default=default_color)
|
color_code = extruder.material.getMetaDataEntry("color_code", default=default_color)
|
||||||
color = colorCodeToRGBA(color_code)
|
color = colorCodeToRGBA(color_code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user