عَنْ عَبْدِ اللَّهِ بْنِ خَبَّابٍ أَنَّ أَبَا سَعِيدٍ الْخُدْرِيِّ رَضِيَ اللَّهُ عَنْهُ ذَكَرَ لِرَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ أَنَّهُ تُصِيبُهُ الْجَنَابَةُ فَيُرِيدُ أَنْ يَنَامَ فَأَمَرَهُ أَنْ يَتَوَضَّأَ ثُمَّ يَنَامَ
Abdullah bin Khabbab reports that Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) mentioned before the Messenger of Allah (peace and blessings be upon him) that he becomes in a state of janabah while he intends to sleep. The Prophet (peace and blessings be upon him) instructed him to perform ablution and then go to sleep.