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

Folder: Do not assume a device is present for all folders

parent 87d023d9
......@@ -137,6 +137,11 @@ bool Folder::blacklist( MediaLibraryPtr ml, const std::string& mrl )
auto folderFs = fsFactory->createDirectory( mrl );
assert( folderFs != nullptr );
auto deviceFs = folderFs->device();
if ( deviceFs == nullptr )
{
LOG_ERROR( "Can't find device associated with mrl ", mrl );
return false;
}
auto device = Device::fromUuid( ml, deviceFs->uuid() );
if ( device == nullptr )
device = Device::create( ml, deviceFs->uuid(), utils::file::scheme( mrl ), deviceFs->isRemovable() );
......
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