We marched with the Messenger of Allah ﷺ on the expedition of Batn Buwat, while he was pursuing Majdi bin Amr al-Juhani. The water-camels were taken in turns among us, five, six, or seven men sharing one. When it came the turn of a man from the Ansar to ride his water-camel, he made it kneel and mounted it, then prodded it to rise, but it balked at him for a moment.He said to it, "Move on, may Allah curse you!"The Messenger of Allah ﷺ asked, "Who is this man cursing his camel?"The man replied, "It is I, Messenger of Allah."He said, "Get down from it. Do not travel in our company with one who is cursed. Do not invoke curses upon yourselves, nor upon your children, nor upon your wealth. You may strike upon an hour from Allah in which a gift is asked, and He grants it to you."
سرنا مع رسول الله ﷺ في غزوة بطن بواط، وهو يطلب المجدي بن عمرو الجهني، وكان الناضح يعقبه منا الخمسة والستة والسبعة، فدارت عقبة رجل من الأنصار على ناضح له، فأناخه، فركبه، ثم بعثه فتلدن عليه بعض التلدن، فقال له: شأ، لعنك الله، فقال رسول الله ﷺ: من هذا اللاعن بعيره؟ قال: أنا يا رسول الله قال: انزل عنه، فلا تصحبنا بملعون، لا تدعوا على أنفسكم، ولا تدعوا على أولادكم، ولا تدعوا على أموالكم، لا توافقوا من الله ساعة يسأل فيها عطاء فيستجيب لكم.
Muslim narrated it in the Book of Asceticism and Softening of Hearts (3009) through several routes from Hatim bin Ismail, from Yaqub bin Mujahid, from Ubada bin Walid bin Ubada bin Samit, from Jabir, in a lengthy context.