* Fix from Bart for unregistering out of range families. Fix issue 39791

(cherry picked from commit a4d8d2c210)
This commit is contained in:
Michaël Van Canneyt 2022-06-19 16:53:58 +02:00 committed by marcoonthegit
parent a672c527d4
commit 756f219494

View File

@ -487,11 +487,14 @@ var
begin
//Apparently this procedure is not supposed to raise exceptions
TheFamilies[AFamily].Deleted:=True;
for i:=0 to Length(TheUnits)-1 do
if AFamily<Length(TheFamilies) then
begin
if TheUnits[i].Fam=AFamily then
TheUnits[i].Deleted:=True;
TheFamilies[AFamily].Deleted:=True;
for i:=0 to Length(TheUnits)-1 do
begin
if TheUnits[i].Fam=AFamily then
TheUnits[i].Deleted:=True;
end;
end;
end;