Reference binding to null pointer error

In the Array section, Maximum subarray sum 2 video, while generating all subarrays, outer for loop is starting with i=0 and in the first iteration while calculating currentSum, cumSum[i-1] is used which is giving runtime error as reference binding to null pointer.
Please clearify it

@slow_motion yes you have to check if i-1>=0 then only you can access it.
it works now in many compilers but if done in any contest it will give runtime for sure.