otsaloma/gaupol

IndexError on preview

casperdewith opened this issue · 3 comments

I clicked on Tools › Preview and a dialog popped up. It said that I had to report the following information:


File: /usr/share/gaupol/gaupol/agents/preview.py
Line: 58
In: _on_preview_activate

    position = page.project.subtitles[row].start

IndexError: list index out of range

Environment

Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35
Locale: en_GB.utf_8

Versions

aeidon: 1.10.1
chardet: 4.0.0
gaupol: 1.10.1
gspell: 1
gstreamer: 1.20.3.0
gtk+: 3.24.33
pygobject: 3.42.1
python: 3.10.6

Hope it helps.

Was this an with empty file, i.e. no subtitles at all?

I was just checking since it sounds weird trying to preview nothing. By my reading of the code that's the case where this can happen. I'll fix it so that the menu item is grayed out if there are no subtitles.