diff --git a/src/history_window.py b/src/history_window.py index f2f33ba44..85a9c6b96 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -120,11 +120,12 @@ class HistoryWindow: # select and show logs for last date we have logs with contact # and if we don't have logs at all, default to today result = gajim.logger.get_last_date_that_has_logs(self.jid) - tim = result[0] - if tim != '': - date = time.localtime(tim) - else: + if result is None: date = time.localtime() + else: + tim = result[0] + date = time.localtime(tim) + y, m, d = date[0], date[1], date[2] self.calendar.select_day(d) self.add_lines_for_date(y, m, d)