maybe fixed null subjects

This commit is contained in:
wowmom98 2017-03-21 22:00:52 -04:00
parent 61879d5a67
commit 41bb30e64a

View file

@ -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)