B2017-209: Restoring an enhanced step whose source step is deleted causes crash
This commit is contained in:
@@ -634,6 +634,17 @@ namespace Volian.Controls.Library
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
RefreshRequired = true;
|
||||
UpdateHistory();
|
||||
MyItemInfo.RefreshConfig();
|
||||
// B2017-209: see if the restore has invalid enhanced data, i.e. the source step that it 'links to' does not exist.
|
||||
// Note that this is only applicable when restoring an enhanced step if its linked source step is deleted because
|
||||
// the enhanced (background/deviation/etc) cannot be deleted unless they are unlinked first.
|
||||
if (MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
// get id for step that is linked & see if it exists - if not, clear the enhanced config data
|
||||
StepConfig sc = MyItemInfo.MyConfig as StepConfig;
|
||||
ItemInfo iexists = ItemInfo.Get(sc.MyEnhancedDocuments[0].ItemID);
|
||||
if (iexists == null) ItemInfo.RemoveEnhancedFromConfig(MyItemInfo, true);
|
||||
}
|
||||
myRTB.Clear();
|
||||
myVFG.Clear();
|
||||
MyEditItem.SetAllTabs();
|
||||
|
Reference in New Issue
Block a user