mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fix crash on settings apply with no game detected
This commit is contained in:
@@ -102,10 +102,12 @@ void LootState::load(YAML::Node& settings) {
|
||||
selectGame("");
|
||||
}
|
||||
|
||||
// Re-initialise the current game in case the game path setting was changed.
|
||||
currentGame_->Init(true);
|
||||
// Update game path in settings object.
|
||||
storeGameSettings(toGameSettings(games_));
|
||||
if (currentGame_ != end(games_)) {
|
||||
// Re-initialise the current game in case the game path setting was changed.
|
||||
currentGame_->Init(true);
|
||||
// Update game path in settings object.
|
||||
storeGameSettings(toGameSettings(games_));
|
||||
}
|
||||
}
|
||||
|
||||
void LootState::init(const std::string& cmdLineGame) {
|
||||
|
||||
@@ -327,7 +327,7 @@ function onCloseSettingsDialog(evt) {
|
||||
loot.DOM.updateSelectedGame(loot.game.folder);
|
||||
})
|
||||
.then(() => {
|
||||
if (loot.game.folder.length === 0) {
|
||||
if (loot.installedGames.length > 0 && loot.game.folder.length === 0) {
|
||||
/* Initialisation failed and game was configured in settings. */
|
||||
onContentRefresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user