“…then he would supplicate.” Its chain of transmission is authentic according to Muslim’s criteria.
Aḥmad also recorded it (1/206) from Ḥammād ibn Salamah, from Ibn Abī Rāfiʿ, from ʿAbd Allāh ibn Jaʿfar: “He gave his daughter in marriage to al-Ḥajjāj ibn Yūsuf and said to her: ‘When he comes in to you, say: There is no god worthy of worship but Allah, the Most Forbearing, the Most Generous. Glory be to Allah, Lord of the Magnificent Throne. All praise is due to Allah, Lord of the worlds.’ He claimed that whenever a matter distressed the Messenger of Allah, peace and blessings be upon him, he would say this.” Ḥammād said: “I thought he said: ‘So he did not get to her.’”
Ibn Abī Rāfiʿ’s name was ʿAbd al-Raḥmān. They mention no transmitter from him other than Ḥammād, yet Ibn Maʿīn said: “Acceptable.” As for al-Ḥāfiẓ, he said: “Accepted”—meaning when corroborated; otherwise, his hadith is weak. I have not found any corroborating narration with this wording, so his hadith remains weak.
2046 — “Just as grapes are not harvested from thorns, so the righteous do not occupy the abodes of the wicked. Take whichever path you wish, for whichever path you take, you will come upon its people.”
Abū Nuʿaym recorded it in al-Ḥilyah (10/31) through Ibrāhīm ibn Yūsuf, who said: Aḥmad ibn Abī al-Ḥawārī narrated to us; Marwān narrated to us, from Yazīd ibn al-Simt, from al-Waḍīn ibn ʿAṭāʾ, from Yazīd ibn Marthad, who said: The Messenger of Allah, peace and blessings be upon him, said it.