diff --git a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp index b030b5c8c7..91e2da77f6 100644 --- a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp @@ -508,10 +508,13 @@ Volume::Volume(fs_volume* fsVolume) Volume::~Volume() { - _StoreAttributes(); - _StoreSharedAttributes(); + if (fRootNode) { + _StoreAttributes(); + _StoreSharedAttributes(); + } - close(fDevice); + if (fDevice >= 0) + close(fDevice); // put_vnode on the root to release the ref to it if (fRootNode)