diff --git a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Comments.cs b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Comments.cs index e58a70c5f7..615d5b1ac5 100644 --- a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Comments.cs +++ b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Comments.cs @@ -7,7 +7,7 @@ public partial class FrameworksController [Route("/Framework/{frameworkId}/Comments/")] public IActionResult InsertComment(int frameworkId, string comment) { - if (comment == "") return RedirectToAction("ViewFramework", new { tabname = "Comments", frameworkId }); + if (string.IsNullOrWhiteSpace(comment)) return RedirectToAction("ViewFramework", new { tabname = "Comments", frameworkId }); var adminId = GetAdminId(); var newCommentId = frameworkService.InsertComment(frameworkId, adminId, comment, null); frameworkNotificationService.SendCommentNotifications(adminId, frameworkId, newCommentId, comment, null, null); @@ -30,7 +30,7 @@ public IActionResult ViewThread(int frameworkId, int commentId) [Route("/Framework/{frameworkId}/Comments/{commentId}")] public IActionResult InsertReply(int frameworkId, int commentId, string comment, string parentComment) { - if (comment == "") return RedirectToAction("ViewThread", new { frameworkId, commentId }); + if (string.IsNullOrWhiteSpace(comment)) return RedirectToAction("ViewThread", new { frameworkId, commentId }); var adminId = GetAdminId(); var newCommentId = frameworkService.InsertComment(frameworkId, adminId, comment, commentId); frameworkNotificationService.SendCommentNotifications(adminId, frameworkId, newCommentId, comment, commentId, parentComment); diff --git a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Review.cs b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Review.cs index facc52bbf3..cd629798a6 100644 --- a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Review.cs +++ b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Review.cs @@ -81,7 +81,7 @@ public IActionResult SubmitFrameworkReview(int frameworkId, int reviewId, string { var adminId = GetAdminId(); int? commentId = null; - if(comment != null) commentId = frameworkService.InsertComment(frameworkId, adminId, comment, null); + if(!string.IsNullOrWhiteSpace(comment)) commentId = frameworkService.InsertComment(frameworkId, adminId, comment, null); frameworkService.SubmitFrameworkReview(frameworkId, reviewId, signedOff, commentId); frameworkNotificationService.SendReviewOutcomeNotification(reviewId); return RedirectToAction("ViewFramework", "Frameworks", new { frameworkId , tabname = "Structure"});