Fix a crash bug when a zero length message is sent