Added exception handling to XML parsing

CURA-3843
This commit is contained in:
Jaime van Kessel 2017-05-19 13:54:31 +02:00
parent 75b3f08318
commit 4b826b747b

View file

@ -425,7 +425,12 @@ class XmlMaterialProfile(InstanceContainer):
# update the serialized data first # update the serialized data first
from UM.Settings.Interfaces import ContainerInterface from UM.Settings.Interfaces import ContainerInterface
serialized = ContainerInterface.deserialize(self, serialized) 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 # Reset previous metadata
self.clearData() # Ensure any previous data is gone. self.clearData() # Ensure any previous data is gone.