create file if it doesn't exist, whoops
This commit is contained in:
parent
b20a2e29a0
commit
faeb2a6334
1 changed files with 4 additions and 0 deletions
|
@ -131,7 +131,11 @@ namespace Buypeeb {
|
||||||
|
|
||||||
private void SaveSettings() {
|
private void SaveSettings() {
|
||||||
string j = JsonSerializer.Serialize(this.settings);
|
string j = JsonSerializer.Serialize(this.settings);
|
||||||
|
string p = System.IO.Path.Combine(this.location, "userdata.json");
|
||||||
Console.WriteLine(j);
|
Console.WriteLine(j);
|
||||||
|
if (!File.Exists(p)) {
|
||||||
|
File.CreateText(p);
|
||||||
|
}
|
||||||
File.WriteAllText(System.IO.Path.Combine(this.location, "userdata.json"), j);
|
File.WriteAllText(System.IO.Path.Combine(this.location, "userdata.json"), j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue