Whenever a deceased man with outstanding debt was brought to the Messenger of Allah ﷺ, he would ask whether the man had left behind enough to cover his debt. If he was told that the man had left sufficient means, he would perform the funeral prayer over him. Otherwise, he would say to the Muslims, "Pray over your companion."When Allah granted him the conquests, he said, "I am closer to the believers than they are to themselves. Whoever among the believers dies leaving a debt, its payment is upon me, and whoever leaves wealth, it belongs to his heirs."
حدثنا يحيى بن بكير حدثنا الليث عن عقيل عن ابن شهاب عن أبي سلمة
أن رسول الله ﷺ كان يؤتى بالرجل المتوفى عليه الدين فيسأل هل ترك لدينه فضلا فإن حدث أنه ترك وفاء صلى وإلا قال للمسلمين صلوا على صاحبكم فلما فتح الله عليه الفتوح قال أنا أولى بالمؤمنين من أنفسهم فمن توفي من المؤمنين فترك دينا فعلي قضاؤه ومن ترك مالا فلورثته