Don't crash if buf is somehow not populated.