diff options
author | Marco Benelli <[email protected]> | 2017-10-25 14:59:55 +0200 |
---|---|---|
committer | Marco Benelli <[email protected]> | 2017-10-26 08:18:36 +0000 |
commit | f12e095fd4828f7f331140601d6323dd56a40dad (patch) | |
tree | 5c5d2e2c0e8450ee962032f5fdb36dffaad77ea5 /src/libs/qmljs/qmljsinterpreter.cpp | |
parent | 1c5d4d9f3b1a6d233f54a4f2b86448648796c769 (diff) |
Qmljs: check pointer to ModelManagerInterface
Task-number: QTCREATORBUG-19152
Change-Id: I3c511d15af943cc92c35a3c3d823080415940780
Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsinterpreter.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsinterpreter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 7e1833dac61..d78ada13f77 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -2239,11 +2239,13 @@ ImportInfo ImportInfo::pathImport(const QString &docPath, const QString &path, } else if (importFileInfo.isDir()) { info.m_type = ImportType::Directory; } else if (path.startsWith(QLatin1String("qrc:"))) { + ModelManagerInterface *model = ModelManagerInterface::instance(); info.m_path = path; - if (ModelManagerInterface::instance()->filesAtQrcPath(info.path()).isEmpty()) - info.m_type = ImportType::QrcDirectory; - else - info.m_type = ImportType::QrcFile; + info.m_type = !model + ? ImportType::UnknownFile + : model->filesAtQrcPath(info.path()).isEmpty() + ? ImportType::QrcDirectory + : ImportType::QrcFile; } else { info.m_type = ImportType::UnknownFile; } |