Mishkat al-Masabih 1586
وَعَن شَقِيق قَالَ: مرض عبد الله بن مَسْعُود فَعُدْنَاهُ فَجَعَلَ يَبْكِي فَعُوتِبَ فَقَالَ: إِنِّي لَا أَبْكِي لِأَجْلِ الْمَرَضِ لِأَنِّي سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: «الْمَرَضُ كَفَّارَةٌ» وَإِنَّمَا أبْكِي أَنه أَصَابَنِي عَلَى حَالِ فَتْرَةٍ وَلَمْ يُصِبْنِي فِي حَال اجْتِهَاد لِأَنَّهُ يكْتب للْعَبد من الْجَرّ إِذَا مَرِضَ مَا كَانَ يُكْتَبُ لَهُ قَبْلَ أَنْ يَمْرَضَ فَمَنَعَهُ مِنْهُ الْمَرَضُ. رَوَاهُ رَزِينٌ
From Shaqiq, who said: ʿAbdullah ibn Masʿud fell ill, and we visited him. He began to weep and was reproached for it. He said: "I do not weep because of the illness, for I heard the Messenger of Allah ﷺ say: 'Illness is an expiation.' I only weep because it struck me in a state of slackness and did not strike me in a state of striving; for when the servant falls ill, there is written for him of reward what used to be written for him before he fell ill and the illness prevented him from it." Reported by Razin.