mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Don't provide setVariant with None as variant
That is not allowed as per the type. This could happen if the preferred variant of a printer also doesn't exist. Fixes Sentry issue CURA-NP.
This commit is contained in:
parent
2687578a86
commit
88bf80c424
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Copyright (c) 2020 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import time
|
||||
|
@ -1424,6 +1424,9 @@ class MachineManager(QObject):
|
|||
machine_definition_id = self._global_container_stack.definition.id
|
||||
machine_node = ContainerTree.getInstance().machines.get(machine_definition_id)
|
||||
variant_node = machine_node.variants.get(variant_name)
|
||||
if variant_node is None:
|
||||
Logger.error("There is no variant with the name {variant_name}.")
|
||||
return
|
||||
self.setVariant(position, variant_node)
|
||||
|
||||
@pyqtSlot(str, "QVariant")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue