Sayyiduna Abu Huraira (may Allah be pleased with him) narrates: The Prophet Muhammad (peace and blessings be upon him) said: "Indeed, Allah has pardoned my Ummah for whatever thoughts occur in their minds, as long as they do not speak about it or act upon it."
Hadith Referenceصحیح ابن حبان / كتاب الأيمان / 4334
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «صحيح أبي داود» (1915): ق.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرطهما