Handle null messages without crashing