From 1a931e6ffbb32cb76a8f66dd65e420b0f969a32c Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 12 Jun 2018 13:30:45 -0400 Subject: [PATCH] feat: Additional validation --- ICD.Common.Utils/StringUtils.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ICD.Common.Utils/StringUtils.cs b/ICD.Common.Utils/StringUtils.cs index f08e271..171fb1f 100644 --- a/ICD.Common.Utils/StringUtils.cs +++ b/ICD.Common.Utils/StringUtils.cs @@ -165,6 +165,9 @@ namespace ICD.Common.Utils [PublicAPI] public static byte[] ToBytes(string input) { + if (input == null) + throw new ArgumentNullException("input"); + return Encoding.GetEncoding(28591).GetBytes(input); } @@ -315,6 +318,9 @@ namespace ICD.Common.Utils /// public static string NiceName(string name) { + if (name == null) + throw new ArgumentNullException("name"); + Regex regex = new Regex(@" (?<=[A-Z])(?=[A-Z][a-z]) | (?<=[^A-Z])(?=[A-Z]) |