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

FsDiscoverer: Don't crash when a root folder can't be found anymore

parent 46b43ad6
......@@ -91,12 +91,21 @@ void FsDiscoverer::reload()
auto blist = blacklist();
for ( const auto& f : rootFolders )
{
auto folder = m_fsFactory->createDirectory( f->path() );
if ( folder->lastModificationDate() == f->lastModificationDate() )
continue;
checkSubfolders( folder.get(), f, blist );
checkFiles( folder.get(), f );
f->setLastModificationDate( folder->lastModificationDate() );
try
{
auto folder = m_fsFactory->createDirectory( f->path() );
if ( folder->lastModificationDate() == f->lastModificationDate() )
continue;
checkSubfolders( folder.get(), f, blist );
checkFiles( folder.get(), f );
f->setLastModificationDate( folder->lastModificationDate() );
}
//FIXME: Have a proper filesystem exception to catch
catch(...)
{
LOG_INFO( "Failed to open ", f->path(), ". Considering it deleted." );
m_ml->deleteFolder( f );
}
}
}
......
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