diff --git a/scripts/plexEmail.py b/scripts/plexEmail.py index 610fa53..d5dfa1e 100644 --- a/scripts/plexEmail.py +++ b/scripts/plexEmail.py @@ -347,8 +347,9 @@ def getSharedUserEmails(): for elem in parsed: for name, value in sorted(elem.attrib.items()): if (name == 'email'): - logging.info('getSharedUserEmails: adding email - ' + value.lower()) - emails.append(value.lower()) + if value: + logging.info('getSharedUserEmails: adding email - ' + value.lower()) + emails.append(value.lower()) logging.info('getSharedUserEmails: Returning shared emails') logging.debug('getSharedUserEmails: email list - ' + ' '.join(emails)) @@ -1742,4 +1743,4 @@ def exceptionHandler(type, value, tb): print 'Emails were not sent because there were no new additions in the timeframe specified.' con.close() -os.remove(DATABASE_FILE + '_plexemail') \ No newline at end of file +os.remove(DATABASE_FILE + '_plexemail')