عَنْ أَبِي قَتَادَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ إِذَا دُعِيَ لِجَنَازَةٍ سَأَلَ عَنْهَا فَإِنْ أُثْنِيَ عَلَيْهَا خَيْرٌ قَامَ فَصَلَّى عَلَيْهَا، وَإِنْ أُثْنِيَ عَلَيْهَا غَيْرُ ذَلِكَ، قَالَ لِأَهْلِهَا: ((شَأْنُكُمْ بِهَا))، وَلَمْ يُصَلِّ عَلَيْهَا
It is narrated from Sayyiduna Abu Qatadah (may Allah be pleased with him) that when the Messenger of Allah (peace and blessings be upon him) was called for the funeral prayer, he (peace and blessings be upon him) would inquire about the deceased. If good things were said about him, then he (peace and blessings be upon him) would perform his funeral prayer. But if the opposite was said, then he (peace and blessings be upon him) would say: "You do whatever you wish for him yourselves." And he (peace and blessings be upon him) would not perform his funeral prayer.
Brief Explanation
Benefits: … The Prophet sallallahu alayhi wa sallam did not perform the funeral prayer (salat al-janazah) for the one who committed treachery, nor for the one who committed suicide, and in the beginning, he would also not perform the funeral prayer for one who was in debt. In this hadith, what is meant by "contrary matters" are which deficiencies?