From faeb2a63341c52a9394a10df44a0d701fdef6b73 Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Fri, 4 Sep 2020 00:17:28 +1000 Subject: [PATCH] create file if it doesn't exist, whoops --- MainWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MainWindow.cs b/MainWindow.cs index c27c984..41277f2 100755 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -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); }