diff options
| author | Manolo Gouy <Manolo> | 2018-05-05 08:30:34 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-05-05 08:30:34 +0000 |
| commit | c68328c2bff997c5f4846592e3f06aea4998f720 (patch) | |
| tree | 8d5b7484493ce17b64c12baeb0c085adeef0bcb6 /src | |
| parent | 733b4de91d7edff33d00fadbc7a9be78d741248f (diff) | |
Add checks for NULL pointer, just in case.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12897 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Widget_Surface.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Fl_Widget_Surface.cxx b/src/Fl_Widget_Surface.cxx index 595e71cb5..f255164fc 100644 --- a/src/Fl_Widget_Surface.cxx +++ b/src/Fl_Widget_Surface.cxx @@ -158,11 +158,13 @@ void Fl_Widget_Surface::print_window_part(Fl_Window *win, int x, int y, int w, i Fl::check(); win->driver()->flush(); // makes the window current Fl_RGB_Image *img = Fl_Screen_Driver::traverse_to_gl_subwindows(win, x, y, w, h, NULL); - img->scale(w, h, 1, 1); + if (img) img->scale(w, h, 1, 1); if (save_front != win) save_front->show(); Fl_Surface_Device::pop_current(); - img->draw(delta_x, delta_y); - delete img; + if (img) { + img->draw(delta_x, delta_y); + delete img; + } } /** |
