summaryrefslogtreecommitdiff
path: root/src/categoriesdialog.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jrim@rimpo.org>2023-12-02 15:52:25 -0600
committerJeremy Rimpo <jrim@rimpo.org>2023-12-02 15:52:25 -0600
commit026fec44680a2e5eb5456972af9c54da03f86529 (patch)
tree68b86799efb6218bdecb17cf6d50d186e78d20a8 /src/categoriesdialog.cpp
parent04eff9750f0ebce85c64046cbf7d0198a4746247 (diff)
Fix crash if no Nexus category is assigned
Diffstat (limited to 'src/categoriesdialog.cpp')
-rw-r--r--src/categoriesdialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/categoriesdialog.cpp b/src/categoriesdialog.cpp
index ff226286..f4515da5 100644
--- a/src/categoriesdialog.cpp
+++ b/src/categoriesdialog.cpp
@@ -148,8 +148,9 @@ void CategoriesDialog::commitChanges()
for (int i = 0; i < ui->categoriesTable->rowCount(); ++i) {
int index = ui->categoriesTable->verticalHeader()->logicalIndex(i);
- QVariantList nexusData =
- ui->categoriesTable->item(index, 3)->data(Qt::UserRole).toList();
+ QVariantList nexusData;
+ if (ui->categoriesTable->item(index, 3) != nullptr)
+ nexusData = ui->categoriesTable->item(index, 3)->data(Qt::UserRole).toList();
std::vector<CategoryFactory::NexusCategory> nexusCats;
for (auto nexusCat : nexusData) {
nexusCats.push_back(CategoryFactory::NexusCategory(