avoid logging if null