"A man passed by the Prophet while he was urinating, and greeted him by the Salam. The Messenger of Allah said to him: "If you see me in this situation, do not greet me with the Salam, for if you do that I will not respond to you.'"
Sunan Ibn Majah Book 1, Hadith 86