Commit aba1f3d8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

FsDiscoverer: Fix potential nullptr dereference

parent 9cc1fdbb
......@@ -240,6 +240,11 @@ std::vector<std::shared_ptr<Folder> > FsDiscoverer::blacklist() const
bool FsDiscoverer::isBlacklisted( const fs::IDirectory& directory, const std::vector<std::shared_ptr<Folder>>& blacklist ) const
auto deviceFs = directory.device();
if ( deviceFs == nullptr )
LOG_WARN( "Failed to fetch device containing ", directory.path() );
return true;
//FIXME: We could avoid fetching the device if the directory is non removable.
auto device = Device::fromUuid( m_ml, deviceFs->uuid() );
// When blacklisting, we would insert the device if we haven't encoutered it yet.
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