The World Federation One Stop Fiqh

Ruling 791

If a person starts performing a prayer when there is ample time, and during it he becomes aware that his body or clothing has become impure, and he deems it probable that it became impure after he started his prayer, then, in case his prayer would not be broken up by washing his body, changing his clothes, or taking them off, he must during the prayer wash his body or clothes, or change his clothing, or take them off, as long as another thing covers his private parts. However, in the event that washing his body or clothes, or changing or removing his clothes, would break up the prayer, or if by removing his clothes he would become naked, then based on obligatory precaution, he must perform his prayer again with pure clothes.