The Messenger of Allah ﷺ said, "When a servant follows a good path of worship and then falls ill, it is said to the angel assigned to him, 'Record for him the equivalent of the deeds he performed when he was healthy, until I release him or take him to Myself.'"
حدثنا عبد الرزاق أخبرنا معمر عن عاصم بن أبي النجود عن خيثمة بن عبد الرحمن
قال رسول الله ﷺ إن العبد إذا كان على طريقة حسنة من العبادة ثم مرض قيل للملك الموكل به اكتب له مثل عمله إذا كان طليقا حتى أطلقه أو أكفته إلي
Its isnad is sahih. Haythami mentioned it in Majma al-Zawaid 2:303, and said, "Ahmad reported it, and its isnad is sahih." Something similar in meaning has already passed from another route, with sahih chains, at 6482, 6825, 6826, and 6870.Munziri mentioned both narrations in Targhib wa Tarhib 4:150, and attributed this last one to Ahmad, saying, "Its isnad is hasan." However, the name of the companion appeared there as Abdullah bin Umar, which is clearly a printing error.As for his saying, "or I gather it to," Munziri said it is spelled with a kaf, then a fa, then a ta with two dots, meaning, "I draw it close to myself and hold it." Ibn Athir said, "Anyone you draw close to something, you have gathered him." In Majma al-Zawaid, it appeared instead as "I cast it," which is certainly an error, whether from a copyist or a typesetter.