From 6225c12a9e06a1c218bae5d6d1240c18a6a16b46 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Jan 2018 09:44:18 +0100 Subject: [PATCH] Fixed crash on complete message In some cases a job won't have an assigned printer when it's done. CL-716 --- plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py index 6c0cc554e7..b5cbc33d51 100644 --- a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py @@ -248,7 +248,10 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): newly_finished_jobs = [job for job in finished_jobs if job not in self._finished_jobs and job.owner == username] for job in newly_finished_jobs: - job_completed_text = i18n_catalog.i18nc("@info:status", "Printer '{printer_name}' has finished printing '{job_name}'.".format(printer_name=job.assignedPrinter.name, job_name = job.name)) + if job.assignedPrinter: + job_completed_text = i18n_catalog.i18nc("@info:status", "Printer '{printer_name}' has finished printing '{job_name}'.".format(printer_name=job.assignedPrinter.name, job_name = job.name)) + else: + job_completed_text = i18n_catalog.i18nc("@info:status", "The print job '{job_name}' was finished.".format(job_name = job.name)) job_completed_message = Message(text=job_completed_text, title = i18n_catalog.i18nc("@info:status", "Print finished")) job_completed_message.show()