mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Prevent crash when sync list somehow contains None
I couldn't figure out how it could ever contain None, but we received logs from a user that indicate a crash here because that set contains None and that is not orderable. This is a hotfix to fail more gracefully instead of crashing the entire application.
This commit is contained in:
parent
b9b086a8c0
commit
969b74e1f6
1 changed files with 3 additions and 0 deletions
|
@ -220,6 +220,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
if printer.printerConfiguration is not None and printer.printerConfiguration.hasAnyMaterialLoaded():
|
||||
all_configurations.add(printer.printerConfiguration)
|
||||
all_configurations.update(printer.availableConfigurations)
|
||||
if None in all_configurations: # Shouldn't happen, but it do. I don't see how it could ever happen. Skip adding that configuration. List could end up empty!
|
||||
Logger.log("e", "Found a broken configuration in the synced list!")
|
||||
all_configurations.remove(None)
|
||||
new_configurations = sorted(all_configurations, key = lambda config: config.printerType or "")
|
||||
if new_configurations != self._unique_configurations:
|
||||
self._unique_configurations = new_configurations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue