diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-02-10 14:11:04 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-02-10 14:11:04 +0100 |
| commit | d53d6f3bcefc3e7f42cdf4920d24dc851aa63b00 (patch) | |
| tree | 34e1cbc0f334a4ce16c3e1240bca11d3202707ca /src/Fl_Window.cxx | |
| parent | 086396ca54bf126edbd495f534a6705b2a9865cb (diff) | |
Fix potential NULL pointer dereference
Diffstat (limited to 'src/Fl_Window.cxx')
| -rw-r--r-- | src/Fl_Window.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index f489fe89a..26e259b5d 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -135,7 +135,7 @@ Fl_Window* Fl_Widget::top_window_offset(int& xoff, int& yoff) const { yoff += w->y(); w = w->window(); // walk up window hierarchy } - return const_cast<Fl_Widget*>(w)->as_window(); + return w ? const_cast<Fl_Widget*>(w)->as_window() : NULL; } /** Gets the x position of the window on the screen */ |
