Added checked to ensure the index of FileList does not go below 0.

Fixes the exception when saving over an existing .flame.

git-svn-id: https://svn.code.sf.net/p/apophysis7x/svn/trunk@3 a5d1c0f9-a0e9-45c6-87dd-9d276e40c949
This commit is contained in:
sjdebdaly 2014-10-04 13:25:41 +00:00
parent 22f0ee1201
commit dbcc7b1762

View File

@ -2025,9 +2025,11 @@ begin
until (Pos('</flame>', FileList[FileList.count - 1]) <> 0) until (Pos('</flame>', FileList[FileList.count - 1]) <> 0)
else else
repeat repeat
if FileList.Count > 0 then
FileList.Delete(FileList.Count - 1); FileList.Delete(FileList.Count - 1);
until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or
(Pos('</flames>', FileList[FileList.count - 1]) <> 0); (Pos('</flames>', FileList[FileList.count - 1]) <> 0) or
(FileList.Count = 0);
end else end else
begin begin
FileList.Delete(FileList.Count - 1); FileList.Delete(FileList.Count - 1);