forked from qt-creator/qt-creator
QtSupport: Fix crash when inserting from an empty list of examples.
Change-Id: I4dbc796577d77e9bca4e8e76e2f68ada3dd440c0 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -455,6 +455,8 @@ void ExamplesListModel::clear()
|
||||
|
||||
void ExamplesListModel::addItems(const QList<ExampleItem> &newItems)
|
||||
{
|
||||
if (newItems.isEmpty())
|
||||
return;
|
||||
beginInsertRows(QModelIndex(), exampleItems.size(), exampleItems.size() - 1 + newItems.size());
|
||||
exampleItems.append(newItems);
|
||||
endInsertRows();
|
||||
|
||||
Reference in New Issue
Block a user