Sunan Ibn Majah, Book 1, Hadith 380 (In-Book) ⓘ
It was narrated from Jabir bin `Abdullah that: "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.'"
حَدَّثَنَا سُوَيْدُ بْنُ سَعِيدٍ، حَدَّثَنَا عِيسَى بْنُ يُونُسَ، عَنْ هَاشِمِ بْنِ الْبَرِيدِ، عَنْ عَبْدِ اللَّهِ بْنِ مُحَمَّدِ بْنِ عَقِيلٍ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ، أَنَّ رَجُلاً، مَرَّ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ وَهُوَ يَبُولُ فَسَلَّمَ عَلَيْهِ فَقَالَ لَهُ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " إِذَا رَأَيْتَنِي عَلَى مِثْلِ هَذِهِ الْحَالَةِ فَلاَ تُسَلِّمْ عَلَىَّ فَإِنَّكَ إِنْ فَعَلْتَ ذَلِكَ لَمْ أَرُدَّ عَلَيْكَ " .
also referenced under: Hadith 352 (Reference) & Volume 1, Book 1, Hadith 352 (DarusSalam)