I see nothing wrong. It is a pity that you didn't say what you thought was wrong here, so I am guessing.
Perhaps you are confused by the use of 'they' and 'their' for a single person.
If so, then rest assured that it is perfectly normal and much better than saying '...if he or she ...'
A: There's someone knocking on the door.
B: Ask them what they want.
Student or Learner