Abdullah bin Abu Qatadah narrates from his father: When the Prophet Muhammad (peace be upon him) was called to perform the funeral prayer for someone, he would inquire about the deceased. If good things were said about him, the Prophet (peace be upon him) would perform his funeral prayer. But if bad things were mentioned, the Prophet (peace be upon him) would say to the family: "You take care of him yourselves," and he would not perform his funeral prayer. (Imam Ibn Hibban, may Allah have mercy on him, says:) The Prophet (peace be upon him) did not perform the funeral prayer for the person whose description we have mentioned. His purpose in this was to teach his Ummah proper etiquette in this regard, so that they would avoid committing such acts. This does not mean that it is not permissible at all to perform the funeral prayer for a person who possesses the characteristic for which the Prophet (peace be upon him) did not perform the funeral prayer.
Hadith Referenceصحیح ابن حبان / كتاب الجنائز وما يتعلق بها مقدما أو مؤخرا / 3057
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الأحكام» (109).فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناد صحيح على شرط الشيخين
Abdullah bin Abu Qatadah narrates from his father: A funeral was brought before the Prophet (peace be upon him) so that the funeral prayer could be performed. The Prophet (peace be upon him) inquired: "Does he have any debt?" The people replied: "Yes, two dinars." The Prophet (peace be upon him) asked: "Did he leave anything for its repayment?" The people replied: "No." So the Prophet (peace be upon him) said: "You perform the funeral prayer of your companion." Abu Qatadah (may Allah be pleased with him) submitted: "O Messenger of Allah (peace be upon him)! The repayment of both is upon me." Then the Prophet (peace be upon him) performed his funeral prayer.
Hadith Referenceصحیح ابن حبان / كتاب الجنائز وما يتعلق بها مقدما أو مؤخرا / 3058
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيحسن صحيح - «أحكام الجنائز» (ص 111).فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده حسن من أجل محمد بن عمرو وهو ابن علقمة الليثي فإن حديثه لا يرتقي إلى الصحة