Hadithcore
Al-Adab Al-Mufrad, 1194
hasan· Al-Albani

Zuhayr reported that one of the Companions of the Prophet, (ﷺ), 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."

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

References2 variants
In-Book Reference
Book 48, Hadith 20
English Reference
Book 48, Hadith 1194