forked from qt-creator/qt-creator
Clang: Fix invalid QTC_ASSERT()
The assertion failed if textDocument was of type e.g. DiffEditorDocument. Change-Id: I00f8734b99c1187c071ef55ff1622fe1f9c3eb56 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -113,9 +113,8 @@ void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor)
|
|||||||
Core::IDocument *document = editor->document();
|
Core::IDocument *document = editor->document();
|
||||||
QTC_ASSERT(document, return);
|
QTC_ASSERT(document, return);
|
||||||
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(document);
|
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
|
// Handle externally changed documents
|
||||||
connect(textDocument, &Core::IDocument::reloadFinished,
|
connect(textDocument, &Core::IDocument::reloadFinished,
|
||||||
this, &ModelManagerSupportClang::onCppDocumentReloadFinished,
|
this, &ModelManagerSupportClang::onCppDocumentReloadFinished,
|
||||||
|
|||||||
Reference in New Issue
Block a user