[fix] Only assign data if it's defined.

This caused `data: undefined` to be added to the packets.
Pointless bytes are pointless