From e62d5ad50c8592bf9e1daadfd4b03e754f23761e Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 1 Jun 2014 22:21:09 -0700 Subject: [PATCH] Fix for nonetype being returned when trying to load data from TVDB Api for actors. --- lib/tvdb_api/tvdb_api.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py index d9f6f550..3ac42736 100644 --- a/lib/tvdb_api/tvdb_api.py +++ b/lib/tvdb_api/tvdb_api.py @@ -781,18 +781,19 @@ class Tvdb: actorsEt = self._getetsrc(self.config['url_actorsInfo'] % (sid)) cur_actors = Actors() - for curActorItem in actorsEt["actor"]: - curActor = Actor() - for k, v in curActorItem.items(): - k = k.lower() - if v is not None: - if k == "image": - v = self.config['url_artworkPrefix'] % (v) - else: - v = self._cleanData(v) - curActor[k] = v - cur_actors.append(curActor) - self._setShowData(sid, '_actors', cur_actors) + if actorsEt: + for curActorItem in actorsEt["actor"]: + curActor = Actor() + for k, v in curActorItem.items(): + k = k.lower() + if v is not None: + if k == "image": + v = self.config['url_artworkPrefix'] % (v) + else: + v = self._cleanData(v) + curActor[k] = v + cur_actors.append(curActor) + self._setShowData(sid, '_actors', cur_actors) def _getShowData(self, sid, language, seriesSearch=False): """Takes a series ID, gets the epInfo URL and parses the TVDB