Praise be to Allah.
Some scholars are of the view that the prayer is invalidated even if he does not decide to cut it short, and some of the scholars said: the prayer is not invalidated because of hesitation, because the basic principle is that the intention remains valid and hesitation does not cancel it out. This view is the correct one; so long as he has not decided to cut short the prayer, then he is still in a state of prayer. End quote.
Majmoo’ Fataawa al-Shaykh Ibn ‘Uthaymeen (12/449)
For more information please see the answer to question number 93529 on our website.
And Allaah knows best.