The Messenger of Allah ﷺ said, "If you find nothing but sheep pens and camel resting-places, then pray in the sheep pens but do not pray in the camel resting-places."
حدثنا أبو بكر بن أبي شيبة حدثنا يزيد بن هارون ح و حدثنا أبو بشر بكر بن خلف حدثنا يزيد بن زريع قالا حدثنا هشام بن حسان عن محمد بن سيرين
قال رسول الله ﷺ إن لم تجدوا إلا مرابض الغنم وأعطان الإبل فصلوا في مرابض الغنم ولا تصلوا في أعطان الإبل
[Hasan] Darimi reported it, 1/323, hadith: 1391, from the hadith of Yazid, in this wording. Tirmidhi graded it sahih, 348, as did Ibn Khuzayma, hadith: 795, and Ibn Hibban (Mawarid), hadith: 336, and Busiri.Hisham used the form "ana" without clarifying direct transmission, but his hadith has a corroborating witness with Tirmidhi, hadith: 349, and others. Ibn Khuzayma graded it sahih, hadith: 796. See also hadith: 770.