mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Prevent error in monitor
Put in place try/except in case data is None
This commit is contained in:
parent
3e4d590617
commit
00ee891952
1 changed files with 16 additions and 9 deletions
|
@ -66,6 +66,9 @@ class Monitor(xbmc.Monitor):
|
||||||
|
|
||||||
data = json.loads(data)
|
data = json.loads(data)
|
||||||
|
|
||||||
|
LOG.info("[ %s: %s ] %s", sender, method, json.dumps(data, indent=4))
|
||||||
|
|
||||||
|
try:
|
||||||
if method != 'LoadServer' and data.get('ServerId') and data['ServerId'] not in self.servers:
|
if method != 'LoadServer' and data.get('ServerId') and data['ServerId'] not in self.servers:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -79,6 +82,10 @@ class Monitor(xbmc.Monitor):
|
||||||
return
|
return
|
||||||
|
|
||||||
server = Emby(data.get('ServerId'))
|
server = Emby(data.get('ServerId'))
|
||||||
|
except Exception as error:
|
||||||
|
|
||||||
|
LOG.error(error)
|
||||||
|
server = Emby()
|
||||||
|
|
||||||
if method == 'GetItem':
|
if method == 'GetItem':
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue