From a513c017077480dcc3738449a8bc801e10fa2b62 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 25 Mar 2015 13:30:08 +0100 Subject: [PATCH] better way to solve the nullpointer issue --- resources/lib/LibrarySync.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 78b432f7..612885c1 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -422,17 +422,16 @@ class LibrarySync(): episodeData = ReadEmbyDB().getEpisodes(tvshow,True) kodiEpisodes = ReadKodiDB().getKodiEpisodes(tvshow,True,True) - if episodeData == None: - return - - if(self.ShouldStop(pDialog)): - return True - - if(pDialog != None): - progressTitle = "Sync DB : Processing Tv Show " + str(showCurrent) + " of " + str(showTotal) - pDialog.update(0, progressTitle) - total = len(episodeData) + 1 - count = 0 + if episodeData != None: + + if(self.ShouldStop(pDialog)): + return True + + if(pDialog != None): + progressTitle = "Sync DB : Processing Tv Show " + str(showCurrent) + " of " + str(showTotal) + pDialog.update(0, progressTitle) + total = len(episodeData) + 1 + count = 0 #we have to compare the lists somehow for item in episodeData: