From: Lars Op den Kamp Date: Fri, 8 Mar 2013 10:27:37 +0000 (+0100) Subject: fixed index out of range exception in CECSettingNumeric.cs. bugzid: 2082 X-Git-Tag: upstream/2.2.0~1^2~5^2~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3490ea720c5ec7532455ac9b434e2d8e6071a2c1;p=deb_libcec.git fixed index out of range exception in CECSettingNumeric.cs. bugzid: 2082 --- diff --git a/src/LibCecTray/settings/CECSettingNumeric.cs b/src/LibCecTray/settings/CECSettingNumeric.cs index 44f856a..9038915 100644 --- a/src/LibCecTray/settings/CECSettingNumeric.cs +++ b/src/LibCecTray/settings/CECSettingNumeric.cs @@ -158,10 +158,13 @@ namespace LibCECTray.settings ResetItems(BaseItems.Count == 0); - control.SelectedValueChanged += delegate - { - Value = BaseItems[control.SelectedIndex]; - }; + if (BaseItems.Count > 0 && control.SelectedIndex < BaseItems.Count) + { + control.SelectedValueChanged += delegate + { + Value = BaseItems[control.SelectedIndex]; + }; + } } public override Control ValueControl