He heard the Messenger of Allah ﷺ say, "When one of you sees a dream that he likes, it is from Allah, so let him praise Allah for it and speak of it. But when he sees something other than that which he dislikes, it is from Satan, so let him seek refuge in Allah from its evil and not mention it to anyone, for it will not harm him."
حدثنا قتيبة بن سعيد حدثنا بكر بن مضر عن ابن الهاد عن عبد الله بن خباب
أنه سمع رسول الله ﷺ يقول إذا رأى أحدكم الرؤيا يحبها فإنما هي من الله فليحمد الله عليها وليحدث بها فإذا رأى غير ذلك مما يكره فإنما هي من الشيطان فليستعذ بالله من شرها ولا يذكرها لأحد فإنها لا تضره
Its isnad is sahih, its narrators are trustworthy and reliable, and Ibn Hadi is Yazid bin Abdullah bin Usama Al-Laythi. Bukhari related the hadith, 9/55, in the chapter on dream interpretation, "If he sees something he dislikes," and Tirmidhi, 5/505, number 3453, in the chapter on supplications, "What one says upon seeing a dream," and he said, hasan sahih.