From f007b524fba622c4a33e0e3e1d657c7712f3e2a9 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 15 May 2019 15:05:06 +0900 Subject: [PATCH] Fixed crashed in kmail/kontact when trying to print a message. The problem was introduced by #25. This resolves #27. Signed-off-by: Michele Calgaro --- kmail/kmreaderwin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp index 76b25715..927a5d59 100644 --- a/kmail/kmreaderwin.cpp +++ b/kmail/kmreaderwin.cpp @@ -436,6 +436,7 @@ KMReaderWin::KMReaderWin(TQWidget *aParent, mHeaderOnlyAttachmentsAction( 0 ), mSelectEncodingAction( 0 ), mToggleFixFontAction( 0 ), + mToggleMimePartTreeAction( 0 ), mCanStartDrag( false ), mHtmlWriter( 0 ), mSavedRelativePosition( 0 ), @@ -1461,7 +1462,8 @@ void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) { saveSplitterSizes( reader ); mMimePartTree->hide(); } - if ( mToggleMimePartTreeAction->isChecked() != mMimePartTree->isVisible() ) { + // mToggleMimePartTreeAction is null in case the reader win was created without an actionCollection + if ( mToggleMimePartTreeAction && mToggleMimePartTreeAction->isChecked() != mMimePartTree->isVisible() ) { mToggleMimePartTreeAction->setChecked( mMimePartTree->isVisible() ); } }