diff options
| author | Manolo Gouy <Manolo> | 2016-04-27 16:27:30 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-27 16:27:30 +0000 |
| commit | 425fe6ac8c31ff1500a1745d67aa6bbe781f5328 (patch) | |
| tree | f3f09f39c6b03855d09a5eed63907b407c6ad7b9 /src/Fl_Native_File_Chooser.cxx | |
| parent | d3402eaa855237617c4c20d358406168deb6b268 (diff) | |
Add tests to avoid null pointer crashes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11702 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Native_File_Chooser.cxx')
| -rw-r--r-- | src/Fl_Native_File_Chooser.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Fl_Native_File_Chooser.cxx b/src/Fl_Native_File_Chooser.cxx index b42a331b5..c5ed7d70d 100644 --- a/src/Fl_Native_File_Chooser.cxx +++ b/src/Fl_Native_File_Chooser.cxx @@ -45,7 +45,7 @@ Fl_Native_File_Chooser::~Fl_Native_File_Chooser() */ void Fl_Native_File_Chooser::type(int t) { - platform_fnfc->type(t); + if (platform_fnfc) platform_fnfc->type(t); } /** @@ -138,7 +138,7 @@ const char *Fl_Native_File_Chooser::filename(int i) const */ void Fl_Native_File_Chooser::directory(const char *val) { - platform_fnfc->directory(val); + if (platform_fnfc) platform_fnfc->directory(val); } /** @@ -156,7 +156,7 @@ const char *Fl_Native_File_Chooser::directory() const */ void Fl_Native_File_Chooser::title(const char *t) { - platform_fnfc->title(t); + if (platform_fnfc) platform_fnfc->title(t); } /** @@ -197,7 +197,7 @@ const char *Fl_Native_File_Chooser::filter() const */ void Fl_Native_File_Chooser::filter(const char *f) { - platform_fnfc->filter(f); + if (platform_fnfc) platform_fnfc->filter(f); } /** @@ -237,7 +237,7 @@ int Fl_Native_File_Chooser::filter_value() const */ void Fl_Native_File_Chooser::preset_file(const char*f) { - platform_fnfc->preset_file(f); + if (platform_fnfc) platform_fnfc->preset_file(f); } /** @@ -267,7 +267,7 @@ const char *Fl_Native_File_Chooser::errmsg() const */ int Fl_Native_File_Chooser::show() { - return platform_fnfc->show(); + return platform_fnfc? platform_fnfc->show() : 1; } // COPY A STRING WITH 'new' |
