An Arabi came to the door of the Messenger of Allah ﷺ and put his eye to a crack in the door. The Prophet ﷺ noticed him and headed toward him with a piece of iron or a stick to poke out his eye. When the man saw this, he pulled away. The Prophet ﷺ said to him, "Had you stayed, I would have put out your eye."
أخبرنا عمرو بن منصور قال حدثنا مسلم بن إبراهيم قال حدثنا أبان قال حدثنا يحيى عن إسحق بن عبد الله بن أبي طلحة
أن أعرابيا أتى باب رسول الله ﷺ فألقم عينه خصاصة الباب فبصر به النبي ﷺ فتوخاه بحديدة أو عود ليفقأ عينه فلما أن بصر انقمع فقال له النبي ﷺ أما إنك لو ثبت لفقأت عينك
No references are available.
[Its isnad is sahih] Bukhari narrated it in Adab al-Mufrad, no. 1091, from the hadith of Abu Aban bin Yazid Attar, through the same chain, and it is also found in Al-Kubra, no. 7063.Yahya is Ibn Abu Kathir, and he explicitly stated that he heard it directly. The hadith has other routes in Sahih Bukhari, no. 6889, and elsewhere.