The Prophet ﷺ said, "Allah has pardoned my Ummah for what they do not utter or act upon, and for the thoughts that pass through their minds."
حدثنا مسلم بن إبراهيم حدثنا هشام عن قتادة عن زرارة بن أوفى
عن النبي ﷺ قال إن الله تجاوز لأمتي عما لم تتكلم به أو تعمل به وبما حدثت به أنفسها
Bukhari transmitted it, in the Book of Manumission, Chapter on mistake and forgetfulness regarding manumission, divorce, and similar matters, no. 2528, and Muslim, in the Book of Faith, Chapter on Allah overlooking what passes through the mind and the fleeting thoughts of the heart when they do not settle, no. 127, from the hadith of Qatada, by this same chain.