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:
Tobias Hunger
2013-08-06 14:55:38 +02:00
parent b852865285
commit af4357b07c

View File

@@ -373,7 +373,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
if (node->nodeType() != FileNodeType)
return;
IEditor *editor = EditorManager::openEditor(node->path());
if (node->line() >= 0)
if (editor && node->line() >= 0)
editor->gotoLine(node->line());
}