mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed init failure if preferred game is not found.
This commit is contained in:
@@ -82,6 +82,12 @@ namespace loot {
|
||||
else if (!preferredGame.empty() && preferredGame == games[i].FolderName() && games[i].IsInstalled())
|
||||
return i;
|
||||
}
|
||||
// Preferred game not found, just pick the first installed one.
|
||||
for (size_t i = 0; i < games.size(); ++i) {
|
||||
if (games[i].IsInstalled())
|
||||
return i;
|
||||
}
|
||||
|
||||
throw error(error::no_game_detected, "None of the supported games were detected.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user