From 20fdb92c777945d610dd14a3058689abf83eaf43 Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Thu, 12 Feb 2015 07:41:44 +0000 Subject: QuickSearch: possible crash avoiding fix git-svn-id: http://svn.miranda-ng.org/main/trunk@12092 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Utils.pas/wrapper.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/Utils.pas/wrapper.pas') diff --git a/plugins/Utils.pas/wrapper.pas b/plugins/Utils.pas/wrapper.pas index 0a8090b105..c6d0c5976d 100644 --- a/plugins/Utils.pas/wrapper.pas +++ b/plugins/Utils.pas/wrapper.pas @@ -342,8 +342,10 @@ begin li.iItem :=item; li.mask :=LVIF_PARAM; li.iSubItem:=0; - SendMessageW(list,LVM_GETITEMW,0,lparam(@li)); - result:=li.lParam; + if SendMessageW(list,LVM_GETITEMW,0,lparam(@li))=0 then + result:=-1 + else + result:=li.lParam; end; function LV_SetLParam(list:HWND;lParam:LPARAM;item:integer=-1):LRESULT; -- cgit v1.2.3