ProjectExplorer: fix possible crashes

Change-Id: I0b06e31f07ddf9c052f360bb66ac2330cc21d7b6
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tim Jenssen
2017-02-10 17:01:38 +01:00
parent a2c6e28478
commit 42061e8cdc
2 changed files with 7 additions and 5 deletions

View File

@@ -407,7 +407,7 @@ void ProjectTreeWidget::showContextMenu(const QPoint &pos)
void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
{
Node *node = m_model->nodeForIndex(mainIndex);
if (node->nodeType() != NodeType::File)
if (!node || node->nodeType() != NodeType::File)
return;
IEditor *editor = EditorManager::openEditor(node->filePath().toString());
if (editor && node->line() >= 0)