diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 30abec1..47a517c 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -597,7 +597,8 @@ void Highlighter::applyIndentationBasedFolding(const QString &text) const data->setFoldingIndent(previousIndent); } } else { - data->setFoldingIndent(m_tabSettings->indentationColumn(text)); + if (m_tabSettings) + data->setFoldingIndent(m_tabSettings->indentationColumn(text)); } } @@ -612,7 +613,14 @@ int Highlighter::neighbouringNonEmptyBlockIndent(QTextBlock block, const bool pr else block = block.next(); } else { - return m_tabSettings->indentationColumn(block.text()); + if (m_tabSettings) + { + return m_tabSettings->indentationColumn(block.text()); + } + else + { + return 0; + } } } }