From c5ae6a8cefc2754368060816561d0e3714bb865d Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Fri, 18 Feb 2011 14:59:12 +0000 Subject: [PATCH] Fixed: list index out of bounds --- X2UtPersistXML.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;