From 31e52f61d02b07442bede64fce4cef0e74a4d3c5 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 28 Nov 2013 16:23:11 +0000 Subject: [PATCH] Fix for #15715: NULL check required in wxRichTextBuffer::SetStyleSheetAndNotify() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 821e62de86..9d4f891add 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -8781,7 +8781,10 @@ bool wxRichTextBuffer::SetStyleSheetAndNotify(wxRichTextStyleSheet* sheet) wxRichTextEvent event(wxEVT_RICHTEXT_STYLESHEET_REPLACING, winid); event.SetEventObject(GetRichTextCtrl()); - event.SetContainer(GetRichTextCtrl()->GetFocusObject()); + if (GetRichTextCtrl()) + event.SetContainer(GetRichTextCtrl()->GetFocusObject()); + else + event.SetContainer(this); event.SetOldStyleSheet(oldSheet); event.SetNewStyleSheet(sheet); event.Allow();