Commit cc97d3e8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Fix potential nullptr dereference

parent 3b9025cb
Pipeline #3987 passed with stages
in 10 minutes and 19 seconds
......@@ -1626,12 +1626,12 @@ void MediaLibrary::DeviceListerCb::onDeviceUnmounted( const std::string& uuid,
const std::string& unmountedMountpoint )
{
auto device = Device::fromUuid( m_ml, uuid );
assert( device->isRemovable() == true );
if ( device == nullptr )
{
LOG_WARN( "Unknown device ", uuid, " was unplugged. Ignoring." );
return;
}
assert( device->isRemovable() == true );
auto mountpoint = utils::file::toFolderPath( unmountedMountpoint );
LOG_INFO( "Device ", uuid, " was unplugged. Mountpoint was ", mountpoint );
for ( const auto& fsFactory : m_ml->m_fsFactories )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment