Return None if bio section is empty

This commit is contained in:
Hugo 2020-04-16 09:31:12 +03:00
parent 2aaa594388
commit a373654500

View file

@ -1142,7 +1142,12 @@ class _BaseObject:
def _extract_cdata_from_request(self, method_name, tag_name, params):
doc = self._request(method_name, True, params)
return doc.getElementsByTagName(tag_name)[0].firstChild.wholeText.strip()
first_child = doc.getElementsByTagName(tag_name)[0].firstChild
if first_child is None:
return None
return first_child.wholeText.strip()
def _get_things(self, method, thing, thing_type, params=None, cacheable=True):
"""Returns a list of the most played thing_types by this thing."""