Like Bazza said, attaching your code is probably the best idea. However, since you mentioned a loop, I would like to venture a guess as to the cause. The number of iterations a for loop will have is determined by the smallest index given to it. That means if you auto index into a loop an array with 4 rows, an array with 8 rows and wire 5 into N, the loop will only run 4 times. That means that any arrays being indexed out of the loop will be size 4. In your case, it's possible the loop runs 0 times and so, if the array is indexed out of the loop, it's size will be 0.
___________________
Try to take over the world!