Zone: fixed bug causing record to get deleted while modify process due to zone object getting removed. Fixed null pointer exception bug.

This commit is contained in:
Shreyas Zare
2018-02-16 22:36:47 +05:30
parent 2fc4203f9f
commit dfb180cb50

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2017 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -834,12 +834,7 @@ namespace DnsServerCore
default:
currentZone.DeleteRecord(oldRecord);
if (oldRecord.Name.Equals(newRecord.Name, StringComparison.CurrentCultureIgnoreCase))
currentZone.AddRecord(newRecord);
else
CreateZone(this, newRecord.Name).AddRecord(newRecord);
CreateZone(this, newRecord.Name).AddRecord(newRecord); //create zone since delete record will also delete empty sub zones
break;
}
}
@@ -862,7 +857,7 @@ namespace DnsServerCore
{
Zone currentZone = GetZone(this, domain, authoritative);
if (currentZone == null)
return null;
return new DnsResourceRecord[] { };
DnsResourceRecord[] records = currentZone.GetAllRecords(includeSubDomains);
if (records != null)