Debugging means you try to figure out what's happening in your program by tracing the flow and look whether variables are holding expected values.

The error message indicates an array is accessed...