From 56df653964f89bfd98b5baec2c935492d57b51a0 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 5 Jun 2007 13:16:11 +0000 Subject: [PATCH] Don't crash if failing to convert text on write git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/file.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/wx/file.h b/include/wx/file.h index 7f3f0e8184..ed551ee7a2 100644 --- a/include/wx/file.h +++ b/include/wx/file.h @@ -100,6 +100,8 @@ public: bool Write(const wxString& s, const wxMBConv& conv = wxConvUTF8) { const wxWX2MBbuf buf = s.mb_str(conv); + if (!buf) + return false; size_t size = strlen(buf); return Write((const char *) buf, size) == size; }