summaryrefslogtreecommitdiff
path: root/src/Fl_Image_Surface.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-27 16:56:36 +0000
committerManolo Gouy <Manolo>2016-04-27 16:56:36 +0000
commit9b186420fffed1c3c804b868a67189cb548446e6 (patch)
tree68e014fd9e625343c3ce572aad204b7c6439d514 /src/Fl_Image_Surface.cxx
parentf4ec7192a9f2c3ada9f7676ca90942306f910db3 (diff)
Add test to avoid null pointer crashes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11704 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Image_Surface.cxx')
-rw-r--r--src/Fl_Image_Surface.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index d69b34c4a..ab1248cc6 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -67,7 +67,7 @@ void Fl_Image_Surface::untranslate() {
}
/** Returns the Fl_Offscreen object associated to the image surface */
-Fl_Offscreen Fl_Image_Surface::offscreen() {return platform_surface->offscreen;}
+Fl_Offscreen Fl_Image_Surface::offscreen() {return platform_surface? platform_surface->offscreen : NULL;}
int Fl_Image_Surface::printable_rect(int *w, int *h) {return platform_surface->printable_rect(w, h);}