Fixed logic that allows the user to select an existing RO database. If the user presses Cancel, the code would crash. The code was changed to cancel the Import. Fixes B2015-216

This commit is contained in:
Rich 2015-11-30 22:36:18 +00:00
parent 5cc71b9e10
commit 8e13fc7179

View File

@ -236,7 +236,7 @@ namespace VEPROMS
dlg.ImportedROFolder = rofolderpath;
dlg.LocalROFolders = localROPaths;
dlg.ShowDialog(this);
if (dlg.SelectedROFolder != string.Empty)
if ((dlg.SelectedROFolder ?? string.Empty) != string.Empty) // B2015-216 If the return value is null treat it like an empty string
{
MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder);
oldRODbID = newRODbID = MyRODb.RODbID;
@ -245,6 +245,7 @@ namespace VEPROMS
else
{
MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate.");
this.Close();// Close the Import Window
return;
}
}