IndexError on preview
casperdewith opened this issue · 3 comments
casperdewith commented
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.
otsaloma commented
Was this an with empty file, i.e. no subtitles at all?
casperdewith commented
Ooh, I don’t know. It could be. I was just starting and was checking out the functions.
In that case, adding a dialog would be useful: it could say that you need at least one line.
…________________________________
From: Osmo Salomaa ***@***.***>
Sent: Sunday, January 15, 2023 12:37:05 AM
To: otsaloma/gaupol ***@***.***>
Cc: casperdewith ***@***.***>; Author ***@***.***>
Subject: Re: [otsaloma/gaupol] Something went wrong when I clicked ‘preview’ (Issue #201)
Was this an with empty file, i.e. no subtitles at all?
—
Reply to this email directly, view it on GitHub<#201 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AILDOJCZN46TBCUWLC6S5P3WSM2CDANCNFSM6AAAAAAT3PT3D4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
otsaloma commented
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.