Answered by Shaykh Faraz Rabbani
Does it invalidate the prayer of a man if he sees a non-mahram woman whose awra is not properly covered?
In the Name of Allah, Most Merciful and Compassionate. May His blessings and peace be on His Beloved Prophet, the best of creation, and his family, companions, and followers
Walaikum assalam wa rahmatullah,
No, this does not invalidate prayer. It would be sinful, of course, to intentionally look.
Wassalam,
Faraz Rabbani