Make sure that ChatDocumentHandler can handle the document being changed to a nullptr
Make sure that ChatDocumentHandler can handle the document being changed to a nullptr. BUG: 501950 (cherry picked from commit97d5be9d81)3f287b20Make sure that ChatDocumentHandler can handle the document being changed to a nullptr. Co-authored-by: James Graham <james.h.graham@protonmail.com>
This commit is contained in:
@@ -117,6 +117,10 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
|
||||
});
|
||||
});
|
||||
connect(this, &ChatDocumentHandler::documentChanged, this, [this]() {
|
||||
if (!m_document) {
|
||||
m_highlighter->setDocument(nullptr);
|
||||
return;
|
||||
}
|
||||
m_highlighter->setDocument(m_document->textDocument());
|
||||
});
|
||||
connect(this, &ChatDocumentHandler::cursorPositionChanged, this, [this]() {
|
||||
|
||||
Reference in New Issue
Block a user