From 7192a33207eb772c3f619bb23a394c8c2230d7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mice=20P=C3=A1pai?= Date: Wed, 26 Apr 2017 01:13:43 +0200 Subject: [PATCH] Fix: _collect_nodes() break if there are no child nodes --- pylast/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pylast/__init__.py b/pylast/__init__.py index 90bbbd1..e608549 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -4156,6 +4156,9 @@ def _collect_nodes(limit, sender, method_name, cacheable, params=None): doc = sender._request(method_name, cacheable, params) doc = cleanup_nodes(doc) + # break if there are no child nodes + if not doc.documentElement.childNodes: + break main = doc.documentElement.childNodes[0] if main.hasAttribute("totalPages"):