diff --git a/PlayerProfile.cs b/PlayerProfile.cs --- a/PlayerProfile.cs +++ b/PlayerProfile.cs @@ -114,18 +114,18 @@ namespace DesertPaintLab public bool Initialize() { - // Create new directory. - System.IO.Directory.CreateDirectory(directory); - - // Copy template files into new directory. - string templatePath = FileUtils.FindApplicationResourceDirectory("template"); - + // Copy template files into new directory. + string templatePath = FileUtils.FindApplicationResourceDirectory("template"); + if (!System.IO.Directory.Exists(templatePath)) { LastError = "Failed to find profile template folder."; return false; } + // Create new directory. + System.IO.Directory.CreateDirectory(directory); + DirectoryInfo di = new DirectoryInfo(templatePath); FileInfo[] templateFiles = di.GetFiles();