Not sure how we could get to this point without having already detected the error, but just to be safe - check for end-of-array and return if error.

Refs #4897