Protect AttributeError from data element without value #38

https://github.com/cleder/fastkml/issues/38
parent 36e8fab2
......@@ -1438,7 +1438,9 @@ class Data(_XMLObject):
def from_element(self, element):
super(Data, self).from_element(element)
self.name = element.get('name')
self.value = element.find('%svalue' % self.ns).text
tmp_value = element.find('%svalue' % self.ns)
if tmp_value is not None:
self.value = tmp_value.text
display_name = element.find('%sdisplayName' % self.ns)
if display_name is not None:
self.display_name = display_name.text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment