Skip to content

Commit 6c9fd55

Browse files
committed
config: Always write config when migrating
Fixes an issue where OBS 30.1.2 migrations would work on the first 30.2.0 load, but the settings would not persist to disk for further loads.
1 parent 7e3f2a8 commit 6c9fd55

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Config.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ void Config::Load(json config)
8787
Save();
8888
}
8989

90+
// If there are migrated settings, write them to disk before processing arguments.
91+
if (!config.empty())
92+
Save();
93+
9094
// Process `--websocket_port` override
9195
QString portArgument = Utils::Platform::GetCommandLineArgument(CMDLINE_WEBSOCKET_PORT);
9296
if (portArgument != "") {
@@ -141,7 +145,9 @@ void Config::Save()
141145
config[PARAM_PASSWORD] = ServerPassword;
142146
}
143147

144-
if (!Utils::Json::SetJsonFileContent(configFilePath, config))
148+
if (Utils::Json::SetJsonFileContent(configFilePath, config))
149+
blog(LOG_DEBUG, "[Config::Save] Saved config.");
150+
else
145151
blog(LOG_ERROR, "[Config::Save] Failed to write config file!");
146152
}
147153

0 commit comments

Comments
 (0)