From 4b826b747be24b1a5bc3c94b2d7537568a114124 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 19 May 2017 13:54:31 +0200 Subject: [PATCH] Added exception handling to XML parsing CURA-3843 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 071548e7e7..bddb801030 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -425,7 +425,12 @@ class XmlMaterialProfile(InstanceContainer): # update the serialized data first from UM.Settings.Interfaces import ContainerInterface serialized = ContainerInterface.deserialize(self, serialized) - data = ET.fromstring(serialized) + + try: + data = ET.fromstring(serialized) + except: + Logger.logException("e", "An exception occured while parsing the material profile") + return # Reset previous metadata self.clearData() # Ensure any previous data is gone.