revuo: fix bounds check

This commit is contained in:
tobtoht 2024-10-07 19:15:48 +02:00
parent 90505aaa32
commit 8eb8d9fc34
No known key found for this signature in database
GPG key ID: E45B10DD027D2472

View file

@ -92,7 +92,7 @@ void RevuoWidget::updateItems(const QList<QSharedPointer<RevuoItem>> &items) {
} }
void RevuoWidget::onSelectItem(int index) { void RevuoWidget::onSelectItem(int index) {
if (index >= m_items.length()) { if (index >= m_items.length() || index < 0) {
ui->textBrowser->setText("<h4>No item selected</h4>"); ui->textBrowser->setText("<h4>No item selected</h4>");
return; return;
} }