Commit c7cf9dc7 authored by Georgios Bitzes's avatar Georgios Bitzes Committed by Elvin Sindrilaru

NS: Prevent empty iterator in Prefetcher from causing a segfault

parent ab7a2ff1
......@@ -218,7 +218,7 @@ void Prefetcher::prefetchFilesystemUnlinkedFileListWithFileMDsAndWait(IView *vie
if(view->inMemory()) return;
Prefetcher prefetcher(view);
for(auto it = fsview->getUnlinkedFileList(location); it->valid(); it->next()) {
for(auto it = fsview->getUnlinkedFileList(location); it && it->valid(); it->next()) {
prefetcher.stageFileMD(it->getElement());
}
......@@ -233,7 +233,7 @@ void Prefetcher::prefetchFilesystemFileListWithFileMDsAndWait(IView *view, IFsVi
if(view->inMemory()) return;
Prefetcher prefetcher(view);
for(auto it = fsview->getFileList(location); it->valid(); it->next()) {
for(auto it = fsview->getFileList(location); it && it->valid(); it->next()) {
prefetcher.stageFileMD(it->getElement());
}
......@@ -248,7 +248,7 @@ void Prefetcher::prefetchFilesystemFileListWithFileMDsAndParentsAndWait(IView *v
if(view->inMemory()) return;
Prefetcher prefetcher(view);
for(auto it = fsview->getFileList(location); it->valid(); it->next()) {
for(auto it = fsview->getFileList(location); it && it->valid(); it->next()) {
prefetcher.stageFileMDWithParents(it->getElement());
}
......
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