From eadce48315ba3850890352008a3406bbc0e4a8b2 Mon Sep 17 00:00:00 2001 From: Andrew Moss Date: Fri, 27 Dec 2013 10:08:50 +0000 Subject: [PATCH] fixed bug wherein empty elements would make get_venue() crash --- pylast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylast.py b/pylast.py index ce887c1..aab208e 100644 --- a/pylast.py +++ b/pylast.py @@ -3648,8 +3648,8 @@ def _extract_element_tree(node, index = 0): targetDict[node.tagName] = {} _recurse_build_tree(node, targetDict[node.tagName]) else: - targetDict[node.tagName] = _unescape_htmlentity(node.firstChild.data.strip()) - + val = None if node.firstChild is None else _unescape_htmlentity(node.firstChild.data.strip()) + targetDict[node.tagName] = val return targetDict return _recurse_build_tree(node, {})