From 50d83dee7e4033ab124192e9f70d984e712ad4ea Mon Sep 17 00:00:00 2001
From: xnappo <cnappi@gmail.com>
Date: Sat, 1 Aug 2015 22:10:43 -0500
Subject: [PATCH] error handling

---
 resources/lib/LibrarySync.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py
index 6a98bc24..d31ef56c 100644
--- a/resources/lib/LibrarySync.py
+++ b/resources/lib/LibrarySync.py
@@ -634,8 +634,10 @@ class LibrarySync(threading.Thread):
                 for item in itemList:
                         
                     MBitem = ReadEmbyDB().getItem(item)
-                    itemType = MBitem.get('Type', "")
-                    
+                    try:
+                        itemType = MBitem.get('Type', "")
+                    except:
+                        itemType = ""
                     #### PROCESS EPISODES ######
                     if "Episode" in itemType:
 
@@ -687,7 +689,10 @@ class LibrarySync(threading.Thread):
                     cursor = connection.cursor()
                     for item in itemList:
                         MBitem = ReadEmbyDB().getItem(item)
-                        itemType = MBitem.get('Type', "")
+                        try:
+                            itemType = MBitem.get('Type', "")
+                        except:
+                            itemType = ""
                         if "MusicArtist" in itemType:
                             WriteKodiMusicDB().addOrUpdateArtistToKodiLibrary(MBitem["Id"],connection, cursor)
                         if "MusicAlbum" in itemType: