Fix potential errors when plugins log with a null message