diff options
| author | Greg Ercolano <erco@seriss.com> | 2019-08-27 16:46:36 -0700 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2019-08-27 16:46:36 -0700 |
| commit | 3340b33bf1b5dc0ac8311075fde6210168ed035d (patch) | |
| tree | 8fd022391bb93fd668c0913ab8e1992d9797059c /src | |
| parent | 0d329a469974617c64217082d3d079f0c66698a4 (diff) | |
Added NULL checks in Fl_Tree_Item::move()
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Tree_Item.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index e6819a8ef..4740c77c0 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -492,17 +492,20 @@ int Fl_Tree_Item::move(Fl_Tree_Item *item, int op, int pos) { case 0: // "above" from_parent = this->parent(); to_parent = item->parent(); + if ( !from_parent || !to_parent ) return -1; from = from_parent->find_child(this); to = to_parent->find_child(item); break; case 1: // "below" from_parent = this->parent(); to_parent = item->parent(); + if ( !from_parent || !to_parent ) return -1; from = from_parent->find_child(this); to = to_parent->find_child(item); break; case 2: // "into" from_parent = this->parent(); + if ( !from_parent ) return -1; to_parent = item; from = from_parent->find_child(this); to = pos; |
