Abu Moosa (may Allah be pleased with him), according to which the Prophet (blessings and peace of Allah be upon him) said: “If a person gets sick or travels, the reward for what he used to do when he was at home and healthy will be recorded for him.” Narrated by al-Bukhaari (2834).
Al-Haafiz Ibn Hajar (may Allah have mercy on him) said: Thuis refers to one who used to do an act of worship then was prevented from doing it, and his intention was that if it was not for that impediment he would have continued doing it, as is mentioned clearly in a report narrated by Abu Dawood via al-‘Awwaam ibn Hawshab, with this isnaad of the report of Hushaym, at the end of which it says: “… like the best he used to do when he was healthy and at home.”
That also appears in the hadeeth of ‘Abd-Allah ibn ‘Amr ibn al-‘Aas, which is attributed to the Prophet (blessings and peace of Allah be upon him): “If a person is doing well in worship then he becomes sick, it is said to the angel who is appointed over him: Record for him (a reward) like that of the action he used to do when he was healthy, until I make him healthy or take him to Me.” Narrated by ‘Abd al-Razzaaq and Ahmad; classed as saheeh by al-Haakim, al-Albaani and the commentators on Musnad Ahmad.
Ahmad narrated a hadeeth from Anas which he attributed to the Prophet (blessings and peace of Allah be upon him): “If Allah tests a Muslim with some calamity in his body, Allah says: ‘Record for him his righteous deeds that he used to do.’ If He heals him, then He has washed him and purified him, and if He takes his (soul, in death), He will forgive him and have mercy on him.” [Classed as hasan by al-Albaani and the commentators on Musnad Ahmad]. …
According to the hadeeth of ‘Aa’ishah which was narrated by al-Nasaa’i: “There is no Muslim man who prays at night then is overcome by sleep or pain, but the reward of his prayer will be recorded for him and his sleep is a charity for him.” [Classed as saheeh by al-Albaani]. End quote from Fath al-Baari.