diff --git a/Bootstrap.Admin/Controllers/Api/ProfilesController.cs b/Bootstrap.Admin/Controllers/Api/ProfilesController.cs index 09e53b19..dc460a4c 100644 --- a/Bootstrap.Admin/Controllers/Api/ProfilesController.cs +++ b/Bootstrap.Admin/Controllers/Api/ProfilesController.cs @@ -55,7 +55,7 @@ namespace Bootstrap.Admin.Controllers.Api fileName = Path.Combine(env.WebRootPath, $"images\\uploader\\{fileName}"); try { - System.IO.File.Delete(fileName); + if (System.IO.File.Exists(fileName)) System.IO.File.Delete(fileName); fileName = "default.jpg"; UserHelper.SaveUserIconByName(userName, fileName); } diff --git a/Bootstrap.Admin/Views/Admin/Profiles.cshtml b/Bootstrap.Admin/Views/Admin/Profiles.cshtml index 13a15689..52a69081 100644 --- a/Bootstrap.Admin/Views/Admin/Profiles.cshtml +++ b/Bootstrap.Admin/Views/Admin/Profiles.cshtml @@ -101,7 +101,7 @@