عَنْ أَبِي قَتَادَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ إِذَا دُعِيَ لِجَنَازَةٍ سَأَلَ عَنْهَا فَإِنْ أُثْنِيَ عَلَيْهَا خَيْرٌ قَامَ فَصَلَّى عَلَيْهَا، وَإِنْ أُثْنِيَ عَلَيْهَا غَيْرُ ذَلِكَ، قَالَ لِأَهْلِهَا: ((شَأْنُكُمْ بِهَا))، وَلَمْ يُصَلِّ عَلَيْهَا
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.