Error: Cannot invoke method toInteger() on null object

Sounds like this is the same issue: