Skip to content

Commit

Permalink
Added null pointer check in item addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Daguerreo committed Dec 1, 2021
1 parent 610014a commit 0d368e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/tree_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ QVariant TreeModel::data(const QModelIndex& index, const int role) const

void TreeModel::addTopLevelItem(TreeItem* child)
{
addItem(_rootItem, child);
if(child){
addItem(_rootItem, child);
}
}

void TreeModel::addItem(TreeItem* parent, TreeItem* child)
{
if(!child){
if(!child || !parent){
return;
}

Expand Down

0 comments on commit 0d368e5

Please sign in to comment.