diff options
Diffstat (limited to 'src/gui/text/qsyntaxhighlighter.cpp')
-rw-r--r-- | src/gui/text/qsyntaxhighlighter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index 0e07b69868..102a776ed3 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -297,7 +297,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block) QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent) : QObject(*new QSyntaxHighlighterPrivate, parent) { - if (parent->inherits("QTextEdit")) { + if (parent && parent->inherits("QTextEdit")) { QTextDocument *doc = parent->property("document").value<QTextDocument *>(); if (doc) setDocument(doc); |