Avoid trying to create a FileLoader for empty filenames

Assorted cleanup
This commit is contained in:
Henrik Rydgård committed 2019-02-25 21:35:51 +01:00
1 parent e3d7ca67a0
commit 0cd3ac06d0
6 files changed
+24 -13

No files matched your search

+5
View File
@@ -229,6 +229,11 @@ bool GameInfo::LoadFromPath(const std::string &gamePath) {
}
std::shared_ptr<FileLoader> GameInfo::GetFileLoader() {
if (filePath_.empty()) {
// Happens when workqueue tries to figure out priorities in PrioritizedWorkQueue::Pop(),
// because priority() calls GetFileLoader()... gnarly.
return fileLoader;
}
if (!fileLoader) {
fileLoader.reset(ConstructFileLoader(filePath_));
}