(58) باب تَجَاوُزِ اللَّهِ عَنْ حَدِيثِ النَّفْسِ، وَالْخَوَاطِرِ، بِالْقَلْبِ إِذَا لَمْ تَسْتَقِرَّ
It is narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) observed:
Verily Allah forgave my people the evil promptings which arise within their hearts as long as they did not speak about them or did not act upon them.
Reference: Sahih Muslim 127 a
In-book reference: Book 1, Hadith 238
USC-MSA web (English) reference(deprecated numbering scheme): Book 1, Hadith 230