|
@@ -451,7 +451,7 @@ namespace GFGGame
|
|
|
else
|
|
|
{
|
|
|
_list.numItems = (_galleryDatas.Count + 1) / 2;
|
|
|
- _list1.numItems = (_galleryDatas.Count - 1) / 2;
|
|
|
+ _list1.numItems = Mathf.Max(0, (_galleryDatas.Count - 1) / 2);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -502,13 +502,24 @@ namespace GFGGame
|
|
|
|
|
|
private void RenderListItem(int index, GObject obj)
|
|
|
{
|
|
|
- long workId = _galleryDatas[index * 2];
|
|
|
+ int num = index * 2;
|
|
|
+ if (_galleryDatas.Count <= num)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ long workId = _galleryDatas[num];
|
|
|
UpdateListItem(workId, obj);
|
|
|
}
|
|
|
|
|
|
private void RenderListItem1(int index, GObject obj)
|
|
|
{
|
|
|
- long workId = _galleryDatas[index * 2 + 1];
|
|
|
+ int num = index * 2 + 1;
|
|
|
+ if (_galleryDatas.Count <= num)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ long workId = _galleryDatas[num];
|
|
|
UpdateListItem(workId, obj);
|
|
|
}
|
|
|
|