From d1886ddb8dc866edd62659263e1406b46b450fcc Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 27 Jul 2017 19:25:38 +0000 Subject: [PATCH] LCL: combobox: sanity check for ItemIndex git-svn-id: trunk@55598 - --- lcl/include/customcombobox.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lcl/include/customcombobox.inc b/lcl/include/customcombobox.inc index c50588ed16..b73ec46f17 100644 --- a/lcl/include/customcombobox.inc +++ b/lcl/include/customcombobox.inc @@ -38,7 +38,7 @@ begin // and use the interface based list FItems := NewStrings; - if FItemIndex <> -1 then + if (FItemIndex > -1) and (FItemIndex < FItems.Count) then TWSCustomComboBoxClass(WidgetSetClass).SetItemIndex(Self, FItemIndex); TWSCustomComboBoxClass(WidgetSetClass).SetStyle(Self, FStyle); TWSCustomComboBoxClass(WidgetSetClass).SetArrowKeysTraverseList(Self, FArrowKeysTraverseList);