Listing all entries in DayOne Classic journal throws IndexError (#786)

* Reproduce bug in #780
🎵 I have no body, no body to love me... 🎵
The bug is cause by a DayOne entry that has to entry body.

* Deal with empty bodies
Close #780.

* [Travis-CI] add "tree" command to debug missing files
* Fix file location
I have no idea why, but it ran locally fine without issue. Travis is more particular...
This commit is contained in:
MinchinWeb 2020-02-08 14:14:33 -07:00
parent 06aa8b50d0
commit cec0beff9a
5 changed files with 65 additions and 8 deletions

View file

@ -22,7 +22,7 @@ class Entry:
def _parse_text(self):
raw_text = self.text
lines = raw_text.splitlines()
if lines[0].strip().endswith("*"):
if lines and lines[0].strip().endswith("*"):
self.starred = True
raw_text = lines[0].strip("\n *") + "\n" + "\n".join(lines[1:])
self._title, self._body = split_title(raw_text)