It was narrated that ‘Aa’ishah (may Allaah be pleased with her), the wife of the Prophet (peace and blessings of Allaah be upon him), said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “There is no calamity that befalls a Muslim but Allaah expiates (sin) thereby, even a thorn that pricks him.” Narrated by al-Bukhaari, 5640; Muslim, 2572.
Muslim (2572) narrated that ‘Aa’ishah said: I heard the Messenger of Allaah (peace and blessings of Allaah be upon him) say: “There is nothing that befalls a believer, not even a thorn that pricks him, but Allaah will record a hasanah (good deed) for him thereby, or erase from him a sin.”