The Messenger of Allah ﷺ said, "There is no person who has a habit of praying at night but is overcome by sleep, except that Allah records for him the reward of his prayer, and his sleep is a charity granted to him."
أخبرنا قتيبة بن سعيد عن مالك عن محمد بن المنكدر عن سعيد بن جبير عن رجل عنده رضى أخبره أن
أن رسول الله ﷺ قال ما من امرئ تكون له صلاة بليل فغلبه عليها نوم إلا كتب الله له أجر صلاته وكان نومه صدقة عليه
[Sahih] Reported by Abu Dawud, Prayer, Chapter: One Who Intends to Stand for Prayer but Falls Asleep, no. 1314, from the hadith of Malik through this same chain, and it is found in the Muwatta (Yahya's recension), 1/117, and in the Kubra, no. 1457.His saying, "from a man in whom he had confidence," refers to Aswad bin Yazid. See the following hadith.