avoid null pointer in logging