Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said, regarding the saying of Allah Almighty: "And whoever intends therein a deviation by wrongdoing, We will make him taste a painful punishment" [Surah al-Hajj: 25]: "Whoever intends a sin and commits it anywhere other than the House (of Allah), it is not recorded against him merely for the intention until he commits it; and whoever intends a sin and commits it within the House, Allah does not take him from this world until He makes him taste a painful punishment."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9046