forked from qt-creator/qt-creator
Fix crash on FlatModel::added with empty list
Change-Id: I6a5970eb9ccd76e730203c2d95dbd4e4dbb4af8a Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -617,6 +617,12 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
|||||||
qCDebug(logger()) << "FlatModel::added" << parentNode->path() << newNodeList.size() << "nodes";
|
qCDebug(logger()) << "FlatModel::added" << parentNode->path() << newNodeList.size() << "nodes";
|
||||||
QModelIndex parentIndex = indexForNode(parentNode);
|
QModelIndex parentIndex = indexForNode(parentNode);
|
||||||
// Old list
|
// Old list
|
||||||
|
|
||||||
|
if (newNodeList.isEmpty()) {
|
||||||
|
qCDebug(logger()) << " newNodeList empty";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode);
|
QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode);
|
||||||
if (it == m_childNodes.constEnd()) {
|
if (it == m_childNodes.constEnd()) {
|
||||||
if (!parentIndex.isValid()) {
|
if (!parentIndex.isValid()) {
|
||||||
|
Reference in New Issue
Block a user