Don't crash if trying to send packets from outside graph

sender can be NULL when message comes from outside the graph.
This feature is used in tests.