}
}
- if (parentIndex >= groups.Count)
+ if (groupInfo != null)
{
- groupInfo.GroupPosition = ScrollContentSize;
- groups.Add(groupInfo);
- }
- else
- {
- groupInfo.GroupPosition = groups[parentIndex].GroupPosition;
- groups.Insert(parentIndex, groupInfo);
- }
+ if (parentIndex >= groups.Count)
+ {
+ groupInfo.GroupPosition = ScrollContentSize;
+ groups.Add(groupInfo);
+ }
+ else
+ {
+ groupInfo.GroupPosition = groups[parentIndex].GroupPosition;
+ groups.Insert(parentIndex, groupInfo);
+ }
- // Update other below group's position
- if (parentIndex + 1 < groups.Count)
- {
- for(int i = parentIndex + 1; i < groups.Count; i++)
+ // Update other below group's position
+ if (parentIndex + 1 < groups.Count)
{
- groups[i].GroupPosition += groupInfo.GroupSize;
- groups[i].StartIndex += count;
+ for(int i = parentIndex + 1; i < groups.Count; i++)
+ {
+ groups[i].GroupPosition += groupInfo.GroupSize;
+ groups[i].StartIndex += count;
+ }
}
- }
- ScrollContentSize += groupInfo.GroupSize;
+ ScrollContentSize += groupInfo.GroupSize;
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", "groupInfo is null! Check count = 0");
+ }
}
else
{