The Messenger of Allah ﷺ said, "A righteous dream is one of seventy parts of prophethood."
قال رسول الله ﷺ: الرؤيا الصالحة جزء من سبعين جزءا من النبوة.
Muslim narrated it in the Book of Dreams (2265) through several routes from Ubaydullah, from Nafi, from Ibn Umar, and he related it. Ahmad narrated it (6215) from Sulayman bin Dawud Hashimi, who said, Saeed bin Abdul-Rahman informed us, from Ubaydullah, with the same wording, adding, "Whoever sees something good should praise Allah and mention it, and whoever sees something other than that should seek refuge with Allah from the evil of his dream and not mention it, for it will not harm him."The more likely view is that this addition is not preserved as part of the hadith of Ibn Umar, for Saeed bin Abdul-Rahman was alone in narrating it, and he is Jumahi, who was truthful but prone to error. Several others narrated it from Ubaydullah, among them Yahya bin Saeed Qattan, Abdullah bin Numayr, and Abu Usama, and they mentioned only the first part of the hadith. However, this addition is established through the hadith of Abu Qatada and others, and it has been documented in its proper place.