Skip to content

Commit

Permalink
Avoid possible dereferencing of null pointer (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoloFLTK committed May 8, 2024
1 parent d428a00 commit e609378
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Fl_Tree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ int Fl_Tree::handle(int e) {
case FL_PUSH: { // clicked on tree
last_my = Fl::event_y(); // save for dragging direction..
if (Fl::visible_focus() && handle(FL_FOCUS)) Fl::focus(this);
if ( ! _root ) return(ret); // issue #971
Fl_Tree_Item *item = _root->find_clicked(_prefs, 0);
// Tell FL_DRAG what was pushed
_lastpushed = item ? item->event_on_collapse_icon(_prefs) ? PUSHED_OPEN_CLOSE // open/close icon clicked
Expand Down

0 comments on commit e609378

Please sign in to comment.