handle null and undefined in log files