mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 15:56:06 +08:00
Fix incorrect type hinting
The type hinting indicated that the property was a dict, but it could also be None. In cases where it was None, it would cause an exception, which was also fixed (since unpacking None will break)
This commit is contained in:
parent
c7350ff579
commit
20ec8828ed
@ -385,7 +385,9 @@ class MachineManager(QObject):
|
||||
# \param definition_id \type{str} definition id that needs to look for
|
||||
# \param metadata_filter \type{dict} list of metadata keys and values used for filtering
|
||||
@staticmethod
|
||||
def getMachine(definition_id: str, metadata_filter: Dict[str, str] = None) -> Optional["GlobalStack"]:
|
||||
def getMachine(definition_id: str, metadata_filter: Optional[Dict[str, str]] = None) -> Optional["GlobalStack"]:
|
||||
if metadata_filter is None:
|
||||
metadata_filter = {}
|
||||
machines = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine", **metadata_filter)
|
||||
for machine in machines:
|
||||
if machine.definition.getId() == definition_id:
|
||||
|
Loading…
x
Reference in New Issue
Block a user