Perhaps change to "if msg.nil?"

Thats just the idiom that I usually see