Kevin,
Thanks for the tip. You said that the integer cannot be null, and I realized that one element of my array was null, and it was throwing that error, because this position was null. I changed it to manually populate a value in this position, but not print out, and it worked without error ...