Added handling for if definition for error handling was not found

CURA-3772
This commit is contained in:
Jaime van Kessel 2017-05-08 10:28:31 +02:00
parent bd276a4d70
commit 63eceda75e

View file

@ -275,7 +275,11 @@ class CuraEngineBackend(QObject, Backend):
error_labels = set()
definition_container = self._global_container_stack.getBottom()
for key in error_keys:
error_labels.add(definition_container.findDefinitions(key = key)[0].label)
definitions = definition_container.findDefinitions(key = key)
if definitions:
error_labels.add(definitions[0].label)
else:
Logger.log("w", "Unable to find definition for key: {key}".format(key = key))
error_labels = ", ".join(error_labels)
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. The following settings have errors: {0}".format(error_labels)))