Commit 55c24db5 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Fix crash in CppCodeModelInspectorDialog

We assumed there is always a BuiltinEditorDocumentParser::get() object,
but that's not the case if clang is used.

Task-number: QTCREATORBUG-13306
Change-Id: Ia48f95a32bf8fd1d208c2a5e70a1af41193d1fd1
Reviewed-by: default avatarChristian Stenger <>
parent 684a037a
......@@ -1365,9 +1365,8 @@ void CppCodeModelInspectorDialog::refresh()
if (editor) {
const QString editorFilePath = editor->document()->filePath();
editorDocument = cmmi->editorDocument(editorFilePath);
if (editorDocument) {
const CPlusPlus::Snapshot editorSnapshot
= BuiltinEditorDocumentParser::get(editorFilePath)->snapshot();
if (auto *builtinDocumentParser = BuiltinEditorDocumentParser::get(editorFilePath)) {
const CPlusPlus::Snapshot editorSnapshot = builtinDocumentParser->snapshot();
m_snapshotInfos->append(SnapshotInfo(editorSnapshot, SnapshotInfo::EditorSnapshot));
const QString editorSnapshotTitle
= QString::fromLatin1("Current Editor's Snapshot (%1 Documents)")
Supports Markdown
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