proper handling of null or undefined message values