Hadith 1559
وَعَنْ عَبْدِ اللَّهِ بْنِ عَمْرٍو قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسلم: إِن الْعَبْدَ إِذَا كَانَ عَلَى طَرِيقَةٍ حَسَنَةٍ مِنَ الْعِبَادَةِ ثُمَّ مَرِضَ قِيلَ لِلْمَلَكِ الْمُوَكَّلِ بِهِ: اكْتُبْ لَهُ مِثْلَ عَمَلِهِ إِذَا كَانَ طَلِيقًا حَتَّى أطلقهُ أَو أكفته إِلَيّ
‘Abdallah b. ‘Amr reported God’s messenger as saying, “When a servant of God is accustomed to worship Him in a good manner, then becomes ill, the angel who is entrusted with him is told to record for him actions equivalent to those which he did when he was well till God sets him free from his illness or takes him in death.” Transmitted in Sharh as-sunna.