From a06a26736fe80d535082a4894da676015a5b0ffe Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 25 Jan 2017 14:17:08 +0100 Subject: Avoid crashing on no source model --- framework/domain/maillistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'framework/domain/maillistmodel.cpp') diff --git a/framework/domain/maillistmodel.cpp b/framework/domain/maillistmodel.cpp index 32370a6b..103f17d9 100644 --- a/framework/domain/maillistmodel.cpp +++ b/framework/domain/maillistmodel.cpp @@ -131,7 +131,7 @@ void MailListModel::runQuery(const Sink::Query &query) void MailListModel::onRowsInserted(const QModelIndex &parent, int begin, int end) { - if (mFetchMails) { + if (mFetchMails && sourceModel()) { for (int row = begin; row <= end; row++) { auto mail = sourceModel()->index(row, 0, parent).data(Sink::Store::DomainObjectRole).value(); if (mail && !mail->getFullPayloadAvailable()) { -- cgit v1.2.3