Fix Coverity null dereferenced warning
It is probably not possible for cur to be nullptr, but best check anyway. Closes CID 1380176
This commit is contained in:
parent
7c3d789514
commit
0bd159b8b7
1 changed files with 4 additions and 1 deletions
|
@ -736,10 +736,13 @@ tree_view_node* tree_view_node::get_node_above()
|
|||
}
|
||||
}
|
||||
|
||||
while(!cur->is_folded() && cur->count_children() > 0) {
|
||||
while(cur && !cur->is_folded() && cur->count_children() > 0) {
|
||||
cur = &cur->get_child_at(cur->count_children() - 1);
|
||||
}
|
||||
|
||||
if (!cur)
|
||||
throw std::domain_error("tree_view_node::get_node_above(): Cannot determine which node is this line, or which node is the line above this one, if any.");
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue