0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

UI: Do not save the project if null

If the jsonData string is null, then there's nothing that should be
written.

Closes pull request #366 from Socapex/debugcrash
This commit is contained in:
Socapex 2015-02-13 00:11:12 -05:00 committed by jp9000
parent 73c7a7f8bb
commit 86d4ee68e6

View File

@ -197,9 +197,14 @@ void OBSBasic::Save(const char *file)
obs_data_t *saveData = GenerateSaveData(); obs_data_t *saveData = GenerateSaveData();
const char *jsonData = obs_data_get_json(saveData); const char *jsonData = obs_data_get_json(saveData);
/* TODO maybe a message box here? */ if (!!jsonData) {
if (!os_quick_write_utf8_file(file, jsonData, strlen(jsonData), false)) /* TODO: maybe a message box here? */
blog(LOG_ERROR, "Could not save scene data to %s", file); bool success = os_quick_write_utf8_file(file, jsonData,
strlen(jsonData), false);
if (!success)
blog(LOG_ERROR, "Could not save scene data to %s",
file);
}
obs_data_release(saveData); obs_data_release(saveData);
} }