QmlJS: Ensure the C++ model manager is available before using it.

Change-Id: I0cc4e59505a6a5baa585e3748fdf174805d661b1
Reviewed-on: http://codereview.qt.nokia.com/3913
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-31 08:43:17 +02:00
parent 0e784e8178
commit 7bc8dd18a3

View File

@@ -524,9 +524,11 @@ QList<LanguageUtils::FakeMetaObject::ConstPtr> FindExportedCppTypes::operator()(
FindExportsVisitor finder(document);
QList<ExportedQmlType> exports = finder();
CppModelManagerInterface::instance()->setExtraDiagnostics(
document->fileName(), CppModelManagerInterface::ExportedQmlTypesDiagnostic,
finder.messages());
if (CppModelManagerInterface *cppModelManager = CppModelManagerInterface::instance()) {
cppModelManager->setExtraDiagnostics(
document->fileName(), CppModelManagerInterface::ExportedQmlTypesDiagnostic,
finder.messages());
}
if (exports.isEmpty())
return noResults;