From b6fc720759fd2ee737aea578dc775267f552525b Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Wed, 22 Aug 2018 09:52:14 -0400 Subject: [PATCH] Fix for path returning None --- get_movies.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/get_movies.py b/get_movies.py index fc43dfb5d..f378ec2b2 100644 --- a/get_movies.py +++ b/get_movies.py @@ -100,7 +100,10 @@ def update_movies(): for added_movie in added_movies: added_path = c.execute('SELECT path FROM table_movies WHERE tmdbId = ?', (added_movie,)).fetchone() - store_subtitles_movie(path_replace_movie(added_path[0])) + if added_path == None: + logging.error("No path returned from DB for movie with tmdbId " + added_movie) + else: + store_subtitles_movie(path_replace_movie(added_path[0])) # Close database connection db.close()