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

MediaLibrary: Fix potential nullptr dereference

(cherry picked from commit cc97d3e8)
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 8c32f3f9
Pipeline #3988 passed with stages
in 13 minutes and 4 seconds
......@@ -1624,12 +1624,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