Sayyiduna Abu Qatadah (may Allah be pleased with him) narrates: Whenever the Prophet (peace and blessings be upon him) was called to a funeral, he would ask about the deceased. If the person was praised, he would get up and offer the funeral prayer over him; and if evil was spoken of the person, he would say to the family: "See to it yourselves," and he would not offer the funeral prayer over that person.
Imam Ahmad recorded it, and its narrators are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3959