Mishkat al-Masabih 467
وَعَن المُهَاجر بن قنفذ: أَنَّهُ أَتَى النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُوَ يَبُولُ فَسَلَّمَ عَلَيْهِ فَلَمْ يَرُدَّ عَلَيْهِ حَتَّى تَوَضَّأ ثمَّ اعتذر إِلَيْهِ فَقَالَ: «إِنِّي كرهت أَن أذكر الله عز وَجل إِلَّا على طهر أَو قَالَ على طَهَارَة» . رَوَاهُ أَبُو دَاوُدَ وَرَوَى النَّسَائِيُّ إِلَى قَوْلِهِ: حَتَّى تَوَضَّأَ وَقَالَ: فَلَمَّا تَوَضَّأَ رَدَّ عَلَيْهِ
From al-Muhajir ibn Qunfudh: He came to the Prophet ﷺ while he was urinating and greeted him, but he did not return his greeting until he had performed wudu. Then he apologised to him and said: "I disliked to mention Allah, Mighty and Majestic, except in a state of purity," or he said: "of purification." Reported by Abu Dawud, and an-Nasaʾi reported it up to his words "until he had performed wudu," and he said: "When he had performed wudu, he returned his greeting."