From dbcc7b1762ccf9beb5879857bc4c8b0c3e44ad0e Mon Sep 17 00:00:00 2001 From: sjdebdaly Date: Sat, 4 Oct 2014 13:25:41 +0000 Subject: [PATCH] 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 --- Forms/Main.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Forms/Main.pas b/Forms/Main.pas index fb1d08a..35c5248 100644 --- a/Forms/Main.pas +++ b/Forms/Main.pas @@ -2025,9 +2025,11 @@ begin until (Pos('', FileList[FileList.count - 1]) <> 0) else repeat - FileList.Delete(FileList.Count - 1); + if FileList.Count > 0 then + FileList.Delete(FileList.Count - 1); until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or - (Pos('', FileList[FileList.count - 1]) <> 0); + (Pos('', FileList[FileList.count - 1]) <> 0) or + (FileList.Count = 0); end else begin FileList.Delete(FileList.Count - 1);