From fa9e0e2cbbcb0733e86a47f489296f58fbcf34af Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 20 May 2018 13:28:02 +0200 Subject: Assert that we have a QGuiApplication if we crash otherwise. --- common/mailpreprocessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/mailpreprocessor.cpp b/common/mailpreprocessor.cpp index 9efa5c9..7bc80cd 100644 --- a/common/mailpreprocessor.cpp +++ b/common/mailpreprocessor.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "pipeline.h" @@ -57,6 +58,9 @@ static QList> processPart(KMime::Content* content) } return list; } else if (type->isHTMLText()) { + //QTextDocument has an implicit runtime dependency on QGuiApplication via the color palette. + //If the QGuiApplication is not available we will crash (if the html contains colors). + Q_ASSERT(QGuiApplication::instance()); // Only get HTML content, if no plain text content QTextDocument doc; doc.setHtml(content->decodedText()); -- cgit v1.2.3