mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
Fix validation logic
This commit is contained in:
@@ -29,9 +29,9 @@ namespace Octokit
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value)
|
||||
&& value.Length == 6
|
||||
&& Regex.IsMatch(value, @"\A\b[0-9a-fA-F]+\b\Z"))
|
||||
if (string.IsNullOrEmpty(value)
|
||||
|| value.Length != 6
|
||||
|| !Regex.IsMatch(value, @"\A\b[0-9a-fA-F]+\b\Z"))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value", "Color should be an hexadecimal string of length 6");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user