Skip to content

Commit

Permalink
Fix crash if no Nexus category is assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Dec 2, 2023
1 parent 04eff97 commit 026fec4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/categoriesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 026fec4

Please sign in to comment.