create file if it doesn't exist, whoops

This commit is contained in:
Lynne Megido 2020-09-04 00:17:28 +10:00
parent b20a2e29a0
commit faeb2a6334
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -131,7 +131,11 @@ namespace Buypeeb {
private void SaveSettings() {
string j = JsonSerializer.Serialize(this.settings);
string p = System.IO.Path.Combine(this.location, "userdata.json");
Console.WriteLine(j);
if (!File.Exists(p)) {
File.CreateText(p);
}
File.WriteAllText(System.IO.Path.Combine(this.location, "userdata.json"), j);
}