prevent a null pointer exception happening in the logs