Fix initial non-existent/empty log issue

Fixes bug where on initial session there is no file, and thus no lines
are read and one thus gets a index out of bounds error as lines is empty...
This commit is contained in:
Jeroen Massar 2019-10-02 18:15:52 +02:00
parent 9fc2c0aebc
commit 911c0478ba

@ -160,6 +160,9 @@ class SessionParser(object):
break
lines.reverse()
if len(lines) == 0:
lines.append("Initial Session");
self.last_session = lines
self.last_session_id = hashlib.md5(lines[0].encode()).hexdigest()
self.last_saved_session_id = self._get_last_saved_session_id()