Return encoded null when string value is None

This commit is contained in:
twangboy 2019-07-01 15:13:56 -06:00
parent 164aaeb64a
commit c4c108227b
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -5845,8 +5845,11 @@ def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
return None
elif etree.QName(element).localname == 'string':
this_vtype = 'REG_SZ'
this_element_value = b''.join([element.text.encode('utf-16-le'),
encoded_null])
if element.text is None:
this_element_value = encoded_null
else:
this_element_value = b''.join([element.text.encode('utf-16-le'),
encoded_null])
elif etree.QName(parent_element).localname == 'elements':
standard_element_expected_string = True
if etree.QName(element).localname == 'boolean':