Maybe you are using something like this to go through a list?
item = ObjectListItem(ItemList,index)
Then you have to make sure that the value of 'index' falls into range.
The first item in a list has index 0, and the last item has ListCount(ItemList)-1, e.g.
for (index, 0, ListCount(ItemList)-1, 1) {
item = ObjectListItem(ItemList,index)
item.bigfancyproperty = something
}