Hadith.4283 - Bakr ibn Muhammad al-Azdi narrated from Abu Basir, from Imam (as), that he said
"If a man swears that he will not rub his nose against a wall, Allah (swt), the Exalted, will test him until he rubs his nose against the wall. And if a man swears that he will not strike his head against the wall, Allah (swt), the Almighty and Glorious, will assign a devil to him until he strikes his head against the wall."