وَعَنْ عُمَرَ بْنِ الْخَطَّابِ وَأَبِي هُرَيْرَةَ
قَالَا: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَا مِنْ رَجُلٍ رَأَى مُبْتَلًى فَقَالَ: الْحَمْدُ لِلَّهِ الَّذِي عَافَانِي مِمَّا ابْتَلَاكَ بِهِ وَفَضَّلَنِي عَلَى كَثِيرٍ مِمَّنْ خَلَقَ تَفْضِيلًا إِلَّا لَمْ يُصِبْهُ ذَلِكَ الْبَلَاءُ كَائِنا مَا كانَ»
Umar ibn al-Khattab and Abu Hurayrah reported God’s messenger as saying that if anyone says, on seeing someone who is suffering affliction, “Praise be to God who has kept me free from the affliction He has brought on him and has shown me favour above many whom He has created,” that affliction, whatever it may be, will not smite him. Tirmidhi transmitted it, and Ibn Majah transmitted it from Ibn Umar Tirmidhi said this is a gharib tradition, and Amr ibn Dinar, the transmitter, is not strong.