[pim/kmail] src: Fix bug 523845: KMail Segmentation fault
Laurent Montel <[email protected]> Tue, 4 Aug 2026 11:27:28 +0000 (UTC)
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 14fd09fe4f5fcb97d8b045a83d99df224f6956ad by Laurent Montel.
Committed on 04/08/2026 at 11:27.
Pushed by mlaurent into branch 'master'.
Fix bug 523845: KMail Segmentation fault
Panel can be null
BUG: 523845
M +5 -0 src/kmmainwidget.cpp
https://invent.kde.org/pim/kmail/-/commit/14fd09fe4f5fcb97d8b045a83d99df224f6956ad
diff --git a/src/kmmainwidget.cpp b/src/kmmainwidget.cpp
index 23f9dbc90..393b5dd5b 100644
--- a/src/kmmainwidget.cpp
+++ b/src/kmmainwidget.cpp
@@ -519,6 +519,11 @@ void KMMainWidget::slotFolderChanged(const Akonadi::Collection &collection)
void KMMainWidget::slotHistorySwitchFolder(const Akonadi::Collection &collection)
{
+ // mMessagePane may be null if this slot fires during createWidgets() before
+ // the CollectionPane constructor has returned and assigned mMessagePane.
+ if (!mMessagePane) {
+ return;
+ }
if (mCurrentCollection == collection) {
return;
}