Skip to content

Commit

Permalink
move item null check in FeatureTreeItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Friedel committed Dec 5, 2023
1 parent 2c6c475 commit 7c19b0c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tools/fm-editor/tree/FeatureTreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ std::vector<FeatureTreeItem *> FeatureTreeItem::getChildrenRecursive() {
}

QVariant FeatureTreeItemFeature::data(int Column) const {
if (Item == nullptr) {
return {};
}
switch (Column) {
case 0:
return QString::fromStdString(Item->getName().str());
case 1:
return Item->isOptional() ? QVariant("") : QVariant("x");
case 2:
return numericValue(Item);
case 3:
return locationString(Item);
case 4:
return QString::fromStdString(Item->getOutputString().str());
default:
return {};
if (Item != nullptr) {
switch (Column) {
case 0:
return QString::fromStdString(Item->getName().str());
case 1:
return Item->isOptional() ? QVariant("") : QVariant("x");
case 2:
return numericValue(Item);
case 3:
return locationString(Item);
case 4:
return QString::fromStdString(Item->getOutputString().str());
default:
return {};
}
}
return {};
}

void FeatureTreeItemFeature::inspect() { emit(inspectSource(Item)); }
Expand Down

0 comments on commit 7c19b0c

Please sign in to comment.