void Config::Load(json config)
{
if (config.is_null()) {
std::string configFilePath = Utils::Obs::StringHelper::GetModuleConfigPath(CONFIG_FILE_NAME);
Utils::Json::GetJsonFileContent(configFilePath, config); // Fetch the existing config, which may not exist
}
// Should never happen, but just in case
if (!config.is_object())
return;
...
This function will exit early if the config.json file doesn't exist on the computer, for example if it was deleted. The expected behaviour would be that it created a new config file (with Config::Save?) in this case.
Current Behavior
The function exits early if config.json doesn't exist, because then config will not satisfy is_object, thus the config flags like ServerEnabled etc. are not written to.
Steps to Reproduce
Delete config.json from app data on Windows or application support on mac
Try to start OBS with a flag like --websocket_debug for instance (it won't trigger if Config::Load exits early)
Operating System Info
Other
Other OS
macOS 14.5
OBS Studio Version
Git
OBS Studio Version (Other)
No response
obs-websocket Version
Git
OBS Studio Log URL
https://obsproject.com/logs/DeqKETHOkSy1QS8C
OBS Studio Crash Log URL
No response
Expected Behavior
In
Config::Load
:This function will exit early if the
config.json
file doesn't exist on the computer, for example if it was deleted. The expected behaviour would be that it created a new config file (withConfig::Save
?) in this case.Current Behavior
The function exits early if
config.json
doesn't exist, because thenconfig
will not satisfyis_object
, thus the config flags likeServerEnabled
etc. are not written to.Steps to Reproduce
config.json
from app data on Windows or application support on mac--websocket_debug
for instance (it won't trigger ifConfig::Load
exits early)Anything else we should know?
No response