I heard the Prophet ﷺ many times say: When a servant of Allah is accustomed to do a good work, then becomes ill or goes on journey, what was accustomed to do when he was well and staying at home will be recorded for him.
سَمِعْتُ النَّبِيَّ ﷺ غَيْرَ مَرَّةٍ وَلاَ مَرَّتَيْنِ يَقُولُ إِذَا كَانَ الْعَبْدُ يَعْمَلُ عَمَلاً صَالِحًا فَشَغَلَهُ عَنْهُ مَرَضٌ أَوْ سَفَرٌ كُتِبَ لَهُ كَصَالِحِ مَا كَانَ يَعْمَلُ وَهُوَ صَحِيحٌ مُقِيمٌ