Sahih MuslimBook 1: The Book of Faith (Kitab Al-Iman) › Chapter 60: WHENEVER A PERSON INTENDS TO DO A GOOD DEED, IT IS RECORDED BUT WHENEVER HE INTENDS TO COMMIT EVIL, IT IS NOT WRITTEN
This hadith has been narrated with another chain of transmitters with the addition of these words: Allah would even wipe out (the evil committed by a man) and Allah does not put to destruction anyone except he who is doomed to destruction.