From 07cc27a0f38b405a6c35eb8d9f5fabc6c643da1b Mon Sep 17 00:00:00 2001 From: Harsimranjeet Singh Date: Wed, 16 Aug 2023 19:19:41 +0530 Subject: [PATCH] null check --- .../Actions/ActionEditPages/ActDataSourcePage.xaml.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Ginger/Ginger/Actions/ActionEditPages/ActDataSourcePage.xaml.cs b/Ginger/Ginger/Actions/ActionEditPages/ActDataSourcePage.xaml.cs index b75ca27f71..8471c75035 100644 --- a/Ginger/Ginger/Actions/ActionEditPages/ActDataSourcePage.xaml.cs +++ b/Ginger/Ginger/Actions/ActionEditPages/ActDataSourcePage.xaml.cs @@ -26,6 +26,7 @@ limitations under the License. using GingerCore.DataSource; using GingerCore.GeneralLib; using GingerCore.Helpers; +using NPOI.OpenXmlFormats.Dml; using System; using System.Collections.Generic; using System.Data; @@ -1939,6 +1940,11 @@ private void MarkAsDone_Unchecked(object sender, RoutedEventArgs e) private void cmbDataSourceName_SelectionChanged(object sender, SelectionChangedEventArgs e) { + if(cmbDataSourceName.SelectedValue == null) + { + return; + } + foreach (DataSourceBase ds in mDSList) { if (ds.Name == cmbDataSourceName.SelectedValue.ToString()) @@ -1977,7 +1983,7 @@ private void cmbDataSourceName_SelectionChanged(object sender, SelectionChangedE private void cmbDataSourceTableName_SelectionChanged(object sender, SelectionChangedEventArgs e) { - if (cmbDataSourceTableName == null || cmbDataSourceTableName.Items.Count == 0) + if (cmbDataSourceTableName == null || cmbDataSourceTableName.Items.Count == 0 || cmbDataSourceTableName.SelectedValue == null) { return; }