mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
1 changed files with 4 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue