From c1a199d6981b7399c29bdb72c33bca9eb17c06e0 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 23 Sep 2014 22:15:13 +0800 Subject: [PATCH] Fix for attribute error when no newznab responses are available --- sickbeard/providers/newznab.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index 332e1e60..eb081f2f 100755 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -312,10 +312,13 @@ class NewznabProvider(generic.NZBProvider): logger.DEBUG) # get total and offset attribs - if total == 0: - total = int(data.feed.newznab_response['total'] or 0) - offset = int(data.feed.newznab_response['offset'] or 0) - + try: + if total == 0: + total = int(data.feed.newznab_response['total'] or 0) + offset = int(data.feed.newznab_response['offset'] or 0) + except AttributeError: + break + # No items found, prevent from doing another search if total == 0: break