Abu Hurairah reported,

The Prophet ﷺ said:A man said, "Tonight I will give a charity." So he went out with his charity and placed it in the hand of an adulteress. The next morning people were talking, saying, "Charity was given last night to an adulteress."He said, "All praise is for You, Allah, for giving charity to an adulteress. I will surely give another charity." So he went out with his charity and placed it in the hand of a wealthy man. The next morning people were talking, saying, "Charity was given last night to a rich man."He said, "All praise is for You, Allah, for giving charity to a rich man. I will surely give another charity." So he went out with his charity and placed it in the hand of a thief. The next morning people were talking, saying, "Charity was given last night to a thief."He said, "All praise is for You, Allah, for giving charity to an adulteress, to a rich man, and to a thief."Then someone came to him and said, "As for your charity, it has been accepted. As for the adulteress, perhaps she will refrain from her adultery because of it. As for the rich man, perhaps he will take heed and spend from what Allah has given him. And as for the thief, perhaps he will refrain from his stealing because of it."

Muslim 2362

Sahih

حدثني سويد بن سعيد حدثني حفص بن ميسرة عن موسى بن عقبة عن أبي الزناد عن الأعرج

عن أبي هريرة

عن النبي ﷺ قال قال رجل لأتصدقن الليلة بصدقة فخرج بصدقته فوضعها في يد زانية فأصبحوا يتحدثون تصدق الليلة على زانية قال اللهم لك الحمد على زانية لأتصدقن بصدقة فخرج بصدقته فوضعها في يد غني فأصبحوا يتحدثون تصدق على غني قال اللهم لك الحمد على غني لأتصدقن بصدقة فخرج بصدقته فوضعها في يد سارق فأصبحوا يتحدثون تصدق على سارق فقال اللهم لك الحمد على زانية وعلى غني وعلى سارق فأتي فقيل له أما صدقتك فقد قبلت أما الزانية فلعلها تستعف بها عن زناها ولعل الغني يعتبر فينفق مما أعطاه الله ولعل السارق يستعف بها عن سرقته

مسلم 2362صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Zakat
Chapter
Confirmation of reward for the giver of charity even if the charity falls into the hands of those undeserving of it
Numbering
Darussalam 2362
Muslim 2362