From e475d2a22d94a97576bf3743f324c7c2bc771cc2 Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Sun, 4 May 2014 23:20:04 +0200 Subject: [PATCH] Only walk lists if they are populated. --- sickbeard/providers/generic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 1b1cc68e..e54c6ecf 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -250,13 +250,16 @@ class GenericProvider: searchStrings += self._get_episode_search_strings(epObj) # remove duplicate search strings - searchStrings = [i for n, i in enumerate(searchStrings) if i not in searchStrings[n + 1:]] + if len(searchString): + searchStrings = [i for n, i in enumerate(searchStrings) if i not in searchStrings[n + 1:]] for curString in sorted(searchStrings): itemList += self._doSearch(curString) # remove duplicate items - itemList = list(set(itemList)) + if len(itemLisT): + itemList = list(set(itemList)) + for item in itemList: (title, url) = self._get_title_and_url(item)