From a565b7f15925dd1dfd5d518d8325dedbeea05d58 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 d6ee580..2259649 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -3984,6 +3984,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"):