summaryrefslogtreecommitdiff
path: root/plugins/Utils.pas/wrapper.pas
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2015-02-12 07:41:44 +0000
committerAlexey Kulakov <panda75@bk.ru>2015-02-12 07:41:44 +0000
commit20fdb92c777945d610dd14a3058689abf83eaf43 (patch)
tree9cce9046a23295ccf3e8df37dcbee241ec546a3e /plugins/Utils.pas/wrapper.pas
parent190df7e09c5d07330acd871c8ff842916f51d223 (diff)
QuickSearch: possible crash avoiding fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@12092 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils.pas/wrapper.pas')
-rw-r--r--plugins/Utils.pas/wrapper.pas6
1 files changed, 4 insertions, 2 deletions
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;