fixed null pointer check to allow "0" and "false" to be valid