Make sure that ChatDocumentHandler can handle the document being changed to a nullptr.
This commit is contained in:
@@ -118,6 +118,10 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
connect(this, &ChatDocumentHandler::documentChanged, this, [this]() {
|
connect(this, &ChatDocumentHandler::documentChanged, this, [this]() {
|
||||||
|
if (!m_document) {
|
||||||
|
m_highlighter->setDocument(nullptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_highlighter->setDocument(m_document->textDocument());
|
m_highlighter->setDocument(m_document->textDocument());
|
||||||
});
|
});
|
||||||
connect(this, &ChatDocumentHandler::cursorPositionChanged, this, [this]() {
|
connect(this, &ChatDocumentHandler::cursorPositionChanged, this, [this]() {
|
||||||
|
|||||||
Reference in New Issue
Block a user