forked from qt-creator/qt-creator
Fix possible crash when clicking on Filenodes with a line number
If the path() set on that node can not be opened, then the editor is 0 and thus there is a crash. Task-number: QBS-367 Change-Id: I8887a3bb84e19292d97357df49ef988d74bf6739 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -373,7 +373,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
|
|||||||
if (node->nodeType() != FileNodeType)
|
if (node->nodeType() != FileNodeType)
|
||||||
return;
|
return;
|
||||||
IEditor *editor = EditorManager::openEditor(node->path());
|
IEditor *editor = EditorManager::openEditor(node->path());
|
||||||
if (node->line() >= 0)
|
if (editor && node->line() >= 0)
|
||||||
editor->gotoLine(node->line());
|
editor->gotoLine(node->line());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user