Fix for #336 

The getStatusIndex returns an integer which can be null. But was storing in an int, which cannot.