diff --git a/X2UtPersistXML.pas b/X2UtPersistXML.pas index 5d98b1c..35e21e5 100644 --- a/X2UtPersistXML.pas +++ b/X2UtPersistXML.pas @@ -196,8 +196,12 @@ begin if SectionStack.Count > 0 then begin lastItem := Pred(SectionStack.Count); - - FSection := (SectionStack[Pred(lastItem)] as IXMLSection); + + if lastItem < 0 then + FSection := Configuration + else + FSection := (SectionStack[Pred(lastItem)] as IXMLSection); + SectionStack.Delete(lastItem); end; end;