FLTK logo

[master] e609378 - Avoid possible dereferencing of null pointer (#971)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] e609378 - Avoid possible dereferencing of null pointer (#971) "ManoloFLTK" 05:02 May 08  
 
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 ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.