Muhajir bin Qunfud reported,

He came to the Prophet ﷺ while he was relieving himself and greeted him, but the Prophet did not return the greeting until he had performed ablution. Then he apologized to him, saying, "I disliked mentioning the name of Allah عز وجل except in a state of purity," or he said, "in a state of purification."

Abu Dawud 17

Daif

حدثنا محمد بن المثنى حدثنا عبد الأعلى حدثنا سعيد عن قتادة عن الحسن عن حضين بن المنذر أبي ساسان

عن المهاجر بن قنفذ

أنه أتى النبي ﷺ وهو يبول فسلم عليه فلم يرد عليه حتى توضأ ثم اعتذر إليه فقال إني كرهت أن أذكر الله عز وجل إلا على طهر أو قال على طهارة

أبو داود 17ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Purification
Chapter
Returning the greeting while urinating
Numbering
Darussalam 17
Abu Dawud 17