Skip to content

Commit

Permalink
fix: crash when open project
Browse files Browse the repository at this point in the history
Log: bug fix
Change-Id: I638fce1121e2ab259397bb1332d8ddb4de3f7a9f
  • Loading branch information
deepin-mozart committed Mar 21, 2024
1 parent b468efe commit 36a96df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/cxx/cmake/project/cmakeasynparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ QStandardItem *CmakeAsynParse::parseProject(QStandardItem *rootItem, const dpfse
targetItem->setToolTip(absolutePath);

targetItem->setData(QVariant::fromValue(target));
targetRootItem->appendRow(targetItem);
if (targetRootItem)
targetRootItem->appendRow(targetItem);

for (const auto &src : target.srcfiles) {
QFileInfo srcFileInfo(src);
Expand All @@ -246,7 +247,8 @@ QStandardItem *CmakeAsynParse::parseProject(QStandardItem *rootItem, const dpfse
srcItem->setToolTip(srcFileInfo.filePath());
srcItem->setIcon(CustomIcons::icon(srcFileInfo));

parentItem->appendRow(srcItem);
if (parentItem)
parentItem->appendRow(srcItem);

allFiles.insert(src);
}
Expand Down

0 comments on commit 36a96df

Please sign in to comment.