Hakim bin Umayr says that Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) wrote to the commanders of the armies: Whichever group of the Muhajirun is overtaken by night while travelling in a village of the mu'ahadin (people under treaty), and they do not host them, then the treaty with them is ended and the protection is lifted.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجزية / 18697