From 80819b3de72451bf3dfed81f9c6d96133d5b17a3 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 12 Nov 2013 13:33:01 +0100 Subject: [PATCH] GLSLEditor: Fix crash when GLSL highligher is used inside diff editor. Task-number: QTCREATORBUG-10671 Change-Id: Ife5b1a5f2ec42ddaa1e1bc4ac1a953f34efd0d1a Reviewed-by: Nikolai Kosjar --- src/plugins/glsleditor/glslhighlighter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/glsleditor/glslhighlighter.cpp b/src/plugins/glsleditor/glslhighlighter.cpp index ae64cd24faa..a298a38baa3 100644 --- a/src/plugins/glsleditor/glslhighlighter.cpp +++ b/src/plugins/glsleditor/glslhighlighter.cpp @@ -92,8 +92,9 @@ void Highlighter::highlightBlock(const QString &text) lex.setState(state); lex.setScanKeywords(false); lex.setScanComments(true); - const int variant = - GLSLTextEditorWidget::languageVariant(static_cast(parent())->mimeType()); + const int variant = GLSLTextEditorWidget::languageVariant(parent() + ? static_cast(parent())->mimeType() + : QString()); lex.setVariant(variant); int initialState = state;