From 67ff2fe3909abb28e544e6cc69e07d3085ba5e39 Mon Sep 17 00:00:00 2001 From: Steve Carr Date: Fri, 11 Mar 2016 10:29:05 -0700 Subject: [PATCH] Bug fix prevent key error when imageInfo is empty --- scripts/plexEmail.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/plexEmail.py b/scripts/plexEmail.py index e3e46ef..51768ff 100644 --- a/scripts/plexEmail.py +++ b/scripts/plexEmail.py @@ -1209,12 +1209,13 @@ def createWebHTML(): pwLink = '' emailText += '' - if (config['filter_show_email_images']): + if (config['filter_show_email_images'] and len(imageInfo) != 0): emailText += '' emailText += '

' + showTitle.decode('utf-8') + '

' emailText += '

S' + str(tvEpisodes[episode]['season_index']) + ' E' + str(tvEpisodes[episode]['index']) + ': ' + title.decode('utf-8') + '

' htmlText += '
' - htmlText += '' + if (len(imageInfo) != 0): + htmlText += '' htmlText += '

' + showTitle.decode('utf-8') + '

' htmlText += '

S' + str(tvEpisodes[episode]['season_index']) + ' E' + str(tvEpisodes[episode]['index']) + ': ' + title.decode('utf-8') + '

' @@ -1558,4 +1559,4 @@ def createWebHTML(): elif (not config['email_enabled']): print 'Emails were not sent because the option is disabled in the config file.' else: - print 'Emails were not sent because there were no new additions in the timeframe specified.' \ No newline at end of file + print 'Emails were not sent because there were no new additions in the timeframe specified.'