Consistent checking for null values in format.js