From a39162749c6c4328336cb2e38dcd165b3ca82cbb Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 27 Mar 2022 14:41:37 +0530 Subject: [PATCH] DnsResourceRecordInfo: fixed issue of missing null check causing error when saving SOA record without comments or when changing server name. --- DnsServerCore/Dns/ResourceRecords/DnsResourceRecordInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordInfo.cs b/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordInfo.cs index 8055c1e1..a1ffd11a 100644 --- a/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordInfo.cs +++ b/DnsServerCore/Dns/ResourceRecords/DnsResourceRecordInfo.cs @@ -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;