From 1a7ac665db1d70a277fa77b87340794e085e9b50 Mon Sep 17 00:00:00 2001 From: Croneter Date: Thu, 22 Mar 2018 17:03:26 +0100 Subject: [PATCH] Fix library sync crash TypeError - Fixes #436 --- resources/lib/kodidb_functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index f0db9d5a..bb90493c 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -230,7 +230,10 @@ class KodiDBMethods(object): """ self.cursor.execute('SELECT idPath FROM files WHERE idFile = ? LIMIT 1', (file_id,)) - path_id = self.cursor.fetchone()[0] + try: + path_id = self.cursor.fetchone()[0] + except TypeError: + return self.cursor.execute('DELETE FROM files WHERE idFile = ?', (file_id,)) self.cursor.execute('DELETE FROM bookmark WHERE idFile = ?',