From e6093782644b83c3c5112b1facf0a680c4005817 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 8 May 2024 13:52:32 +0200 Subject: Avoid possible dereferencing of null pointer (#971) --- src/Fl_Tree.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Fl_Tree.cxx') diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index a545a321c..50f13b988 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -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 -- cgit v1.2.3