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:
Nikolai Kosjar
2015-07-08 15:08:13 +02:00
parent 5b583ad67e
commit 3a2c9f6d4b

View File

@@ -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,