When one of you dozes in prayer he should sleep till his sleep is gone, for when one of you prays while he is dozing, perhaps he might curse himself if he begs pardon of Allah. (Using translation from Abū Dāʾūd 1310)
عَنِ النَّبِيِّ ﷺ قَالَ إِذَا نَعَسَ أَحَدُكُمْ وَهُوَ يُصَلِّي فَلْيَرْقُدْ حَتَّى يَذْهَبَ عَنْهُ النَّوْمُ فَإِنَّهُ إِذَا صَلَّى وَهُوَ يَنْعَسُ لَعَلَّهُ يَذْهَبُ يَسْتَغْفِرُ فَيَسُبُّ نَفْسَهُ