It is narrated from Sayyiduna Ali bin Shiban Yamami (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: "Whoever sleeps at night on the roof of a house that has no covering or barrier, then there is no responsibility (of Allah) for him." Abu Abdullah says: Its chain of narration is questionable.
Hadith Referenceالادب المفرد / كتاب / 1192
Hadith Gradingالألبانی:صحيح
Hadith Takhrij«صحيح : أخرجه أبوداؤد ، كتاب الأدب ، باب فى النوم على سطح غير محجر : 5041 - أنظر الصحيحة : 674»
Explanation & Benefits
Shaykh Maulana Usman Muneeb
Benefits and Issues: The point is that a believing servant is under the responsibility of Allah, and it is the promise of that Exalted Being to all people that He will protect them, provided that the servants themselves do not break this covenant. If a person sleeps on a bare roof without any barrier, and then falls from the roof during the night, this is his own fault, because it is entirely possible that a person may get up in his sleep at night and not be aware that he is sleeping on a roof, and thus fall. Therefore, sleeping on a bare roof is not permissible.
Source: Fadlullah al-Ahad: Urdu Commentary on al-Adab al-Mufrad, Page: 1192