forked from organicmaps/organicmaps
[MAPSME-5018,MAPSME-5019] [ios] Fixed crash with out of bounds vector index.
This commit is contained in:
parent
903562d2d9
commit
ec383f7c98
1 changed files with 5 additions and 1 deletions
|
@ -193,7 +193,11 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
for (UIView * v in self.buttons)
|
||||
{
|
||||
[v.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
|
||||
auto const type = m_visibleButtons[v.tag - 1];
|
||||
auto const buttonIndex = v.tag - 1;
|
||||
NSAssert(buttonIndex >= 0, @"Invalid button index.");
|
||||
if (buttonIndex < 0 || buttonIndex >= m_visibleButtons.size())
|
||||
continue;
|
||||
auto const type = m_visibleButtons[buttonIndex];
|
||||
[MWMActionBarButton addButtonToSuperview:v
|
||||
delegate:self
|
||||
buttonType:type
|
||||
|
|
Loading…
Add table
Reference in a new issue