All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The scholars mentioned that man is not punished for his thoughts and whispers as long as he does not act upon them or speak (i.e. say them) about them, because the Prophet informed us that Allaah forgave his nation for the thoughts they have as long as they do not act upon them or talk about them [Al-Bukhari and Muslim].
This is of course if one is not determined to act upon such thoughts, as in such case it is forbidden and a person may be punished for them if he does not repent.
It is also confirmed in the Sunnah that a Muslim is rewarded for his good intentions even if he does not act upon them, and he will exactly get the same reward of the acts which he intended to do or wished to do as if he did them, because Allaah is Most Generous and He rewards for good intentions. Allaah is also Most Forgiving and Most Merciful and He overlooks the bad thoughts and whispers which one did not really wish to act upon or determined to do.
Allaah Knows best.