Someone who spends the night on a roof without Al-Adab Al-Mufrad 1194

Arabic hadith text
حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، قَالَ‏:‏ حَدَّثَنَا الْحَارِثُ بْنُ عُبَيْدٍ قَالَ‏:‏ حَدَّثَنِي أَبُو عِمْرَانَ، عَنْ زُهَيْرٍ، عَنْ رَجُلٍ مِنْ أَصْحَابِ النَّبِيِّ صلى الله عليه وسلم، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ‏:‏ مَنْ بَاتَ عَلَى إِنْجَارٍ فَوَقَعَ مِنْهُ فَمَاتَ، بَرِئَتْ مِنْهُ الذِّمَّةُ، وَمَنْ رَكِبَ الْبَحْرَ حِينَ يَرْتَجُّ، يَعْنِي‏:‏ يَغْتَلِمُ، فَهَلَكَ بَرِئَتْ مِنْهُ الذِّمَّةُ‏.‏
Translation

Zuhayr reported that one of the Companions of the Prophet, may Allah bless him and grant him peace, said, "If anyone spends the night on a flat roof (without walls) and then falls off of it and dies, no one bears any responsibility for him. If anyone embarks on the sea when it is fierce (i.e. stormy) and is destroyed, no one bears any responsibility for him."