forked from qt-creator/qt-creator
Fix index out of range crash
Change-Id: Ifa943d3d240c7ffab0bd21f50ff66d796c78401e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -101,7 +101,7 @@ bool SubComponentManager::addImport(const Import &import, int index)
|
||||
}
|
||||
|
||||
if (importExists) {
|
||||
if (index == -1)
|
||||
if (index == -1 || index > m_imports.size())
|
||||
m_imports.append(import);
|
||||
else
|
||||
m_imports.insert(index, import);
|
||||
|
Reference in New Issue
Block a user