B2020-070 Added null reference checks.

This commit is contained in:
John Jenko 2020-05-13 19:43:00 +00:00
parent 9b363aa847
commit 462315f282

View File

@ -164,6 +164,7 @@ namespace Volian.Controls.Library
void tabSearchTypes_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e) void tabSearchTypes_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
{ {
if(wordSectionTreeNode != null) //B2020-070 NULL reference check
wordSectionTreeNode.Enabled = true; wordSectionTreeNode.Enabled = true;
btnSearch.Enabled = true; btnSearch.Enabled = true;
if (e.NewTab == tabROSearch) if (e.NewTab == tabROSearch)
@ -171,9 +172,12 @@ namespace Volian.Controls.Library
LoadROComboTree(); LoadROComboTree();
} }
else if (e.NewTab == tabTranSearch) else if (e.NewTab == tabTranSearch)
{
if (wordSectionTreeNode != null) //B2020-070 NULL reference check
{ {
wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search
wordSectionTreeNode.Checked = false; wordSectionTreeNode.Checked = false;
}
btnSearch.Enabled = (cbxTranCategory.Items.Count > 0); // B2017-038 disable search button if no format selected btnSearch.Enabled = (cbxTranCategory.Items.Count > 0); // B2017-038 disable search button if no format selected
//enable-disable doc version nodes based on version type if selected //enable-disable doc version nodes based on version type if selected
if (cbxTranVersion.SelectedIndex > -1) if (cbxTranVersion.SelectedIndex > -1)