From d2d9079d55afe3a6b674806375c1c4ad0d691c1a Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Mon, 2 Aug 2021 22:16:31 -0400 Subject: [PATCH] Try/catch input sanitization --- Posting.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Posting.cs b/Posting.cs index 195998d..7b26de6 100644 --- a/Posting.cs +++ b/Posting.cs @@ -83,8 +83,12 @@ public class Posting } i++; } - Regex boxRegex = new Regex(@"(Box \d+)"); - this.BoxNumber = boxRegex.Matches(this.NotesOnApplying)[0].Value.Replace("Box ", ""); + try + { + Regex boxRegex = new Regex(@"(Box \d+)"); + this.BoxNumber = boxRegex.Matches(this.NotesOnApplying)[0].Value.Replace("Box ", ""); + } + catch (Exception) { } this.BargainingUnit = this.BargainingUnit.Replace("&", "&"); this.VacancyID = id; }