From ade0ad1b9ec3645de3983bbbc860a13b4a1eb795 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 2 Dec 2011 23:17:18 +0000 Subject: [PATCH] lazutils: avglvltree: fixed FindPointer on last node git-svn-id: trunk@33923 - --- components/lazutils/avglvltree.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/lazutils/avglvltree.pas b/components/lazutils/avglvltree.pas index 806daf99e6..45c43d7e9a 100644 --- a/components/lazutils/avglvltree.pas +++ b/components/lazutils/avglvltree.pas @@ -923,7 +923,8 @@ begin while (Result<>nil) do begin if Result.Data=Data then break; Result:=FindSuccessor(Result); - if Compare(Data,Result.Data)<>0 then Result:=nil; + if Result=nil then exit(nil); + if Compare(Data,Result.Data)<>0 then exit(nil); end; end;