mirror of https://github.com/buggins/dlangui.git
selectTab - checks for illegal index value
Don't send illegal index value to object list and cause exception, just output error to console instead
This commit is contained in:
parent
b06d485d12
commit
0f0ac6a527
|
|
@ -557,6 +557,10 @@ class TabControl : WidgetGroupDefaultDrawing {
|
|||
}
|
||||
|
||||
void selectTab(int index, bool updateAccess) {
|
||||
if (index < 0 || index + 1 >= _children.count) {
|
||||
Log.e("Tried to access tab out of bounds (index = %d, count = %d)",index,_children.count-1);
|
||||
return;
|
||||
}
|
||||
if (_children.get(index + 1).compareId(_selectedTabId))
|
||||
return; // already selected
|
||||
string previousSelectedTab = _selectedTabId;
|
||||
|
|
|
|||
Loading…
Reference in New Issue