From 77d650f4b1dc14964ea5194ef3899f4af6d3f157 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Sun, 18 Jun 2023 14:37:15 -0400 Subject: Fix crash when copying status when non is selected This was an overlooked crash that only happens when done on purpose, as you generally don't press the copy button when nothing is selected. --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 05e8d8a..b9b268c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -76,7 +76,7 @@ void MainWindow::on_buttonRandom_clicked() { } void MainWindow::on_buttonCopy_clicked() { - if (data_archive == nullptr) return; + if (data_archive == nullptr or ui->listWidget->selectedItems().isEmpty()) return; StatusListItem* item = dynamic_cast(ui->listWidget->selectedItems()[0]); if (item != nullptr) { -- cgit v1.2.3-54-g00ecf