Prevent NPE when generating log