Logger: Test for None after fetchone()

fetchone() returns None when nothing is found
len(None) yields a TypeError
This commit is contained in:
Philipp Hörist 2018-03-24 17:13:15 +01:00
parent 77dc975023
commit 058d3db1b0
1 changed files with 1 additions and 1 deletions

View File

@ -525,7 +525,7 @@ class Logger:
''' % msg_log_id ''' % msg_log_id
) )
results = self.cur.fetchone() results = self.cur.fetchone()
if len(results) == 0: if results is None:
# Log line is no more in logs table. remove it from unread_messages # Log line is no more in logs table. remove it from unread_messages
self.set_read_messages([msg_log_id]) self.set_read_messages([msg_log_id])
continue continue