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; }