DnsResourceRecordInfo: fixed issue of missing null check causing error when saving SOA record without comments or when changing server name.

This commit is contained in:
Shreyas Zare
2022-03-27 14:41:37 +05:30
parent 0dd0f0fd3d
commit a39162749c

View File

@@ -222,7 +222,7 @@ namespace DnsServerCore.Dns.ResourceRecords
get { return _comments; }
set
{
if (value.Length > 255)
if ((value is not null) && (value.Length > 255))
throw new ArgumentOutOfRangeException(nameof(Comments), "Resource record comment text cannot exceed 255 characters.");
_comments = value;