1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

Fixed Array::remove (ElementType*) so that if given an invalid pointer, it doesn't attempt to remove anything after the assert.

This commit is contained in:
Timur Doumler 2016-10-05 13:06:26 +01:00
parent a440c16d89
commit e8cdc65357

View file

@ -853,7 +853,12 @@ public:
jassert (data.elements != nullptr);
const int indexToRemove = int (elementToRemove - data.elements);
jassert (isPositiveAndBelow (indexToRemove, numUsed));
if (! isPositiveAndBelow (indexToRemove, numUsed))
{
jassertfalse;
return;
}
removeInternal (indexToRemove);
}