Commit 3a2c9f6d authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

Clang: Fix invalid QTC_ASSERT()



The assertion failed if textDocument was of type e.g.
DiffEditorDocument.

Change-Id: I00f8734b99c1187c071ef55ff1622fe1f9c3eb56
Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
parent 5b583ad6
......@@ -113,9 +113,8 @@ void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor)
Core::IDocument *document = editor->document();
QTC_ASSERT(document, return);
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(document);
QTC_ASSERT(textDocument, return);
if (cppModelManager()->isCppEditor(editor)) {
if (textDocument && cppModelManager()->isCppEditor(editor)) {
// Handle externally changed documents
connect(textDocument, &Core::IDocument::reloadFinished,
this, &ModelManagerSupportClang::onCppDocumentReloadFinished,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment