mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
fix: dont insert at an index which was removed
This commit is contained in:
@@ -148,6 +148,10 @@ namespace ICD.Common.Utils.Collections
|
|||||||
if (!inserted)
|
if (!inserted)
|
||||||
{
|
{
|
||||||
int insertIndex = removeIndices[0];
|
int insertIndex = removeIndices[0];
|
||||||
|
|
||||||
|
if (insertIndex >= kvp.Value.Count)
|
||||||
|
kvp.Value.Add(item);
|
||||||
|
else
|
||||||
kvp.Value.Insert(insertIndex, item);
|
kvp.Value.Insert(insertIndex, item);
|
||||||
m_Count++;
|
m_Count++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user