The Prophet ﷺ said, "A righteous dream is one of seventy parts of prophethood. So whoever sees something good, let him praise Allah for it and speak of it, and whoever sees something other than that, let him seek refuge in Allah from the evil of his dream and not mention it, for it will not harm him."
حدثنا سليمان بن داود الهاشمي أخبرنا سعيد بن عبد الرحمن عن عبيد الله عن نافع
أن النبي ﷺ قال الرؤيا الصالحة جزء من سبعين جزءا من النبوة فمن رأى خيرا فليحمد الله عليه وليذكره ومن رأى غير ذلك فليستعذ بالله من شر رؤياه ولا يذكرها فإنها لا تضره
Its isnad is sahih. The first part of it has already appeared several times, the first instance at 4678 and the last at 6035. As for its second part, "whoever sees good, etc.," it was not narrated in the Six Books from the hadith of Ibn Umar. For that reason Haythami mentioned the whole hadith among the additional narrations, at 174 and 175, saying, "Ahmad and Tabarani in al-Awsat narrated it, and its narrators are the narrators of the Sahih, except for Sulayman bin Dawud Hashimi, who is trustworthy."