It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that a man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah, what do you say about a man who recited the Qur'an in the early part of the night and then stole in the last part of the night?" the Messenger of Allah (peace and blessings be upon him) said: "Since he recited in the early part of the night, this very deed will stop him from stealing in the darkness of the last part of the night."
Imam Ibn Abi Shaybah narrated this hadith. In its chain Muhammad bin Abi Layla has been declared da'if (weak) because of his poor memory; however, its meaning is supported by other sahih texts, namely that good deeds keep a person away from evils.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الصلاة / 212
Hadith Gradingمحدثین:إسناده ضعيف
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده ضعيف. » «أورده ابن حجر فى "المطالب العالية"، 212، 3497»