Is دفع الضرر (averting harm) considered showing off (riyaa'), such as praying in the mosque to avoid expulsion, or refraining from reciting Al-Fatiha to follow the Imam out of fear of embarrassment, and is such a prayer valid?
A person's action of performing something by which closeness to Allah is sought, not with the intention of seeking closeness to Him, but to ward off harm from oneself, falls under the reality of showing off (riya'). An example of this is praying in the mosque for fear of expulsion. The intention must be corrected, and the prayer should begin with the intention of seeking closeness to Allah, not to ward off harm. The prayer is valid according to some scholars if the Imam bows before completing Surah Al-Fatiha, and you bow along with him.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/181190