mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 23:59:03 +08:00
Convert all metadata fields to string
The XML builder expects string, strictly. Only None is handled separately. Contributes to issue CURA-3808.
This commit is contained in:
parent
f4f6be103e
commit
c48017e174
@ -159,10 +159,10 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
|
||||
for key, value in metadata.items():
|
||||
builder.start(key)
|
||||
# Normally value is a string.
|
||||
# Nones get handled well.
|
||||
if isinstance(value, bool):
|
||||
value = str(value) # parseBool in deserialize expects 'True'.
|
||||
if value is not None: #Nones get handled well by the builder.
|
||||
#Otherwise the builder always expects a string.
|
||||
#Deserialize expects the stringified version.
|
||||
value = str(value)
|
||||
builder.data(value)
|
||||
builder.end(key)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user