From 41bb30e64ab39f92bd5ef6be1b41bcef03529ac9 Mon Sep 17 00:00:00 2001 From: wowmom98 Date: Tue, 21 Mar 2017 22:00:52 -0400 Subject: [PATCH] maybe fixed null subjects --- Project-Unite/Controllers/ForumController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Project-Unite/Controllers/ForumController.cs b/Project-Unite/Controllers/ForumController.cs index 4236286..c416cbd 100644 --- a/Project-Unite/Controllers/ForumController.cs +++ b/Project-Unite/Controllers/ForumController.cs @@ -254,6 +254,10 @@ public ActionResult CreateTopic(CreateTopicViewModel model) return new HttpStatusCodeResult(404); string subjectId = model.Subject; + + if (String.IsNullOrWhiteSpace(model.Subject) == true) + ViewBag.Error = "hey no null subjects"; + char[] badChars = subjectId.Where(x => !AllowedChars.Contains(x)).ToArray(); foreach(var c in badChars)