handle data.credit when it's null
Merge pull request #3266 from dimagi/credits-fix

handle data.credit when it's null