From 419bedc55a0d573ab5dbaba3fb48a17c4d21fb1b Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Fri, 8 Sep 2017 16:40:43 +0200 Subject: [PATCH] Potential fix for #81 --- mastodon/Mastodon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1e1d90e..4774761 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -829,7 +829,7 @@ class Mastodon: Returns the next page or None if no further data is available. """ - if isinstance(previous_page, list): + if isinstance(previous_page, list) and len(previous_page) != 0: if '_pagination_next' in previous_page[-1]: params = copy.deepcopy(previous_page[-1]['_pagination_next']) else: @@ -853,7 +853,7 @@ class Mastodon: Returns the previous page or None if no further data is available. """ - if isinstance(next_page, list): + if isinstance(next_page, list) and len(previous_page) != 0: if '_pagination_prev' in next_page[0]: params = copy.deepcopy(next_page[0]['_pagination_prev']) else: