Turn answer to zero, if null or empty

Without seeing the PHP code involved I can only guess.

But you may be able to solve the problem by explicitly casting to an Int or maybe you need to use strict type comparison.