From f3f9a2393f26ec02d0d25aa64d37c8706bd20eb0 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Wed, 16 Oct 2019 20:24:50 +0100 Subject: [PATCH 1/2] Return early from _checkStackForErrors() if top container is empty. --- plugins/CuraEngineBackend/StartSliceJob.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index b973a0775a..06ef2d97b1 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -106,6 +106,10 @@ class StartSliceJob(Job): if stack is None: return False + # if there are no per-object settings we don't need to check the other settings here + if stack.getTop() == None or len(stack.getTop().getAllKeys()) == 0: + return False + for key in stack.getAllKeys(): validation_state = stack.getProperty(key, "validationState") if validation_state in (ValidatorState.Exception, ValidatorState.MaximumError, ValidatorState.MinimumError, ValidatorState.Invalid): From 82bd89991e7ee6f15da5ec1baa0d22111796842a Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 17 Oct 2019 16:42:43 +0100 Subject: [PATCH 2/2] Improve code style. --- plugins/CuraEngineBackend/StartSliceJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 06ef2d97b1..94f6d3edfa 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -107,7 +107,7 @@ class StartSliceJob(Job): return False # if there are no per-object settings we don't need to check the other settings here - if stack.getTop() == None or len(stack.getTop().getAllKeys()) == 0: + if stack.getTop() is None or not stack.getTop().getAllKeys(): return False for key in stack.getAllKeys():