Skip to content

Commit d5119c0

Browse files
authored
Don't load non-existent JSON (#8450)
Prevent this error when a new JSON settings is saved: ``` [ error ] ofLoadJson: Error loading json from "/Users/steve/Documents/MarkSynth/settings/synth1/settings-4.json": file doesn't exist ``` I'm also suspicious of L235-237 for the same reason, but there's no error message when loading a non-existent XML so not sure.
1 parent b691e6b commit d5119c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/ofxGui/src/ofxBaseGui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void ofxBaseGui::saveToFile(const of::filesystem::path & filename){
239239
xml.save(filename);
240240
}else
241241
if(extension == ".json"){
242-
ofJson json = ofLoadJson(filename);
242+
ofJson json;
243243
saveTo(json);
244244
ofSavePrettyJson(filename, json);
245245
}else{

0 commit comments

Comments
 (0)