mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-07-05 22:40:41 +12:00
Fix initial config creation when no config exists yet
This commit is contained in:
parent
77bc221455
commit
5a5bdb2410
|
@ -216,6 +216,13 @@ namespace SystemTrayMenu.Properties
|
|||
config.Add(userSettings);
|
||||
doc.Add(config);
|
||||
doc.Declaration = declaration;
|
||||
|
||||
string? dir = Path.GetDirectoryName(path);
|
||||
if (!Directory.Exists(dir))
|
||||
{
|
||||
Directory.CreateDirectory(dir!);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
doc.Save(path);
|
||||
|
|
Loading…
Reference in a new issue