fix null exception in logger