There are among Muslims who are sleepy or even fall asleep when performing a prayer, regardless of whether it is part of the devil's trick or pure state of health.
Could be concerned is the priest who followed by some people behind him makum. You can imagine how tough the situation when the imam fell asleep in his prayer. While the prosperity is still waiting even with a sense of full of indecisiveness between continuing or deciding the congregation or prayer.
Then the question now, if it happens, whether the prayer is considered void or not? Sleeping in the jurisprudence of the Shafi'i school is considered one of the most potent abrogators, with a note that the sleeping person is in a position to lie down, lie face down, or sit while leaning against something.
But if the concerned fell asleep in a fixed sitting condition, then it does not matter. This provision is explained at length by Imam As-Syirazi in his work Al-Muhaddzab as follows.
وأما النوم فينظر فيه فإن وجد منه وهو مضطجع أو مكب أو متكئ انتقض وضوؤه, وإن وجد منه وهو قاعد ومحل الحدث متمكن من الأرض فالمنصوص في الكتب أنه لا ينتقض وضوؤه.
That is, "As for sleep (in relation to wudu), it is detailed as follows. If a person is asleep and he is lying down, lying face down, or leaning (to something), then his wudu is void. But if the person is asleep in a sitting condition and his ass remains (unchanged) on the floor, it is written in some books (Shafi'i fiqh) that his wudunya does not void. "
Based on the above provisions, then there is no problem when someone is asleep before performing the prayer, because it is only adjusted whether the sleep is in a condition of lying down, facedown, or leaning on something or sitting in a fixed condition. If in the first condition, then wudhunya void so that even if he perform the prayer then automatically shalatnya was also canceled because wudu is one of the requirements of prayer.
But if the sleep is in second condition, then the wudhunya is not void so he may just perform the prayer with ablution 'which he did before falling asleep.
While sleeping during prayer, according to Imam Nawawi, there are differences of opinion. The opinion that is close to the truth in this case is the opinion that states that sleeping in a fixed sitting condition, does not cancel ablution, whether in prayer or not, whether sleeping long or briefly. While falling asleep in other conditions such as lying down, facedown, leaning on something, ruku, prostration, or standing, will cause ablution and prayer a person becomes void. You know.