summaryrefslogtreecommitdiff
path: root/src/Fl_Tree.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-08 13:52:32 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-08 13:52:32 +0200
commite6093782644b83c3c5112b1facf0a680c4005817 (patch)
tree4aed575546adc5a2dccd0a859f268f9e14c768dc /src/Fl_Tree.cxx
parentd428a0044388596d19dd20f32471e24146e40975 (diff)
Avoid possible dereferencing of null pointer (#971)
Diffstat (limited to 'src/Fl_Tree.cxx')
-rw-r--r--src/Fl_Tree.cxx1
1 files changed, 1 insertions, 0 deletions
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