eliascotto / export-kobo

A Python tool to export annotations and highlights from a Kobo SQLite file. Now with web UI.
MIT License
26 stars 2 forks source link

Add handling for class "Item" property "text" being null #2

Closed chris-jelly closed 1 year ago

chris-jelly commented 2 years ago

Disclaimer

First pull request. Roast me.

Fixes #1

Problem

In the Item class, the init method was encountering an error on assigning self.text with values[1] when it was null, as it was calling strip on a null value

Why does the problem exist

I do not know what changed (if anything) in the sqlite schema to cause this new issue.

Solution

Adding a quick check to only set the property if the value is not none fixes the immediate issues, however the self.text property must exist for line 141, so I added an else clause to manually set to None.

eliascotto commented 1 year ago

Thanks, resolved with new version.