|
|
commit e6093782644b83c3c5112b1facf0a680c4005817
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed May 8 13:52:32 2024 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed May 8 13:52:32 2024 +0200
Avoid possible dereferencing of null pointer (#971)
src/Fl_Tree.cxx | 1 +
1 file changed, 1 insertion(+)
diff --git src/Fl_Tree.cxx src/Fl_Tree.cxx
index a545a32..50f13b9 100644
--- src/Fl_Tree.cxx
+++ 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
[ Direct Link to Message ] | |
|
| |