B2021-045: Search/Load, don’t crash if noncompatible Xml file
This commit is contained in:
parent
1e85522762
commit
814d26f713
@ -2321,12 +2321,14 @@ namespace Volian.Controls.Library
|
|||||||
lbSrchResults.DataSource = null;
|
lbSrchResults.DataSource = null;
|
||||||
lbSrchResults.Items.Clear();
|
lbSrchResults.Items.Clear();
|
||||||
toolTip1.SetToolTip(lbSrchResults, null);
|
toolTip1.SetToolTip(lbSrchResults, null);
|
||||||
Cursor = Cursors.WaitCursor;
|
|
||||||
string unitPrefix = "";
|
string unitPrefix = "";
|
||||||
if (Mydocversion != null)
|
if (Mydocversion != null)
|
||||||
unitPrefix = Mydocversion.DocVersionConfig.Unit_ProcedureNumber;
|
unitPrefix = Mydocversion.DocVersionConfig.Unit_ProcedureNumber;
|
||||||
if (unitPrefix.EndsWith("#"))
|
if (unitPrefix.EndsWith("#"))
|
||||||
unitPrefix = unitPrefix.Replace("#", "");
|
unitPrefix = unitPrefix.Replace("#", "");
|
||||||
|
Cursor = Cursors.WaitCursor;
|
||||||
|
try // B2021-045: don't crash if xml file cannot be loaded.
|
||||||
|
{
|
||||||
SearchResults = ItemInfoList.GetByContentID(0);
|
SearchResults = ItemInfoList.GetByContentID(0);
|
||||||
// C2021-006: removed all file type options except xml
|
// C2021-006: removed all file type options except xml
|
||||||
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
||||||
@ -2460,6 +2462,12 @@ namespace Volian.Controls.Library
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
FlexibleMessageBox.Show("An error occurred while reading the xml file.\r\n\r\nThis can happen when the file selected for the Load is not saved\r\n" +
|
||||||
|
"from a PROMS Search or if some of the steps no longer exist.", "Search Load Failed", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
|
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user