diff --git a/Form1.cs b/Form1.cs index d286442..02892eb 100644 --- a/Form1.cs +++ b/Form1.cs @@ -159,12 +159,15 @@ private void Form1_Close(object sender, FormClosingEventArgs e) if (cleanupOnShutDown) ToastNotificationManagerCompat.Uninstall(); - // Then, all saved avatars. - var files = Directory.GetFiles("images"); - - foreach (var file in files) + // Then, all saved avatars (if the save folder exists). + if (Directory.Exists("images")) { - File.Delete(file); + var files = Directory.GetFiles("images"); + + foreach (var file in files) + { + File.Delete(file); + } } }