Fix null pointer exception when sending empty message.

Well it sure didn't take long for me to introduce a bug. Anyway fix this
case, which I botched while 'simplifying' it.