Merge "Ensure taskbar hotseat array index is in bounds" into sc-dev
This commit is contained in:
commit
b9672a668d
1 file changed
+4
-1
@@ -78,7 +78,10 @@ public class TaskbarHotseatController {
|
|||||||
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
|
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
|
||||||
// Since the hotseat might be laid out vertically or horizontally, use whichever
|
// Since the hotseat might be laid out vertically or horizontally, use whichever
|
||||||
// index is higher.
|
// index is higher.
|
||||||
hotseatItemInfos[Math.max(lp.cellX, lp.cellY)] = itemInfo;
|
int index = Math.max(lp.cellX, lp.cellY);
|
||||||
|
if (0 <= index && index < hotseatItemInfos.length) {
|
||||||
|
hotseatItemInfos[index] = itemInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user