Stay calm. This happens, even with precautions.
Immediate steps:
1. Don't overreact - this will make them afraid to tell you in the future
2. Ask them to explain what they saw and how it made them feel
3. Reassure them they're not in trouble for seeing it
4. Discuss why it's inappropriate in age-appropriate terms
5. Decide together if they should continue playing that game