From ac470216094638b0c542574bf77710185e4e7a31 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 3 Aug 2016 18:52:14 +0000 Subject: [PATCH] Added a null reference check for selectedDVI on the tc_PanelTabDisplay() function. Added logic to skip the checks for changed integrated graphics (figures) when the RO database has none. --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 1 + .../Extension/ROFSTExt.cs | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 2679525c..6506739d 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -2889,6 +2889,7 @@ namespace VEPROMS } private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) { + if (_SelectedDVI == null) return; if (args.PanelTabName == "Bookmarks") { toolsPanel.Expanded = true; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 6aff2310..4b645c70 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -391,16 +391,19 @@ namespace VEPROMS.CSLA.Library /// List of ROIDs with changed figures private static void FindChangedFiles(ROFSTLookup.rochild[] rochild,List ChangedFiles, List roids) { - for (int i = 0; i < rochild.Length; i++) + if (ChangedFiles != null) { - if (rochild[i].type == 8 && rochild[i].value != null) + for (int i = 0; i < rochild.Length; i++) { - string filename = rochild[i].value; - filename = filename.Substring(0, filename.IndexOf('\n')); - if(ChangedFiles.Contains(filename)) - roids.Add(rochild[i].roid); + if (rochild[i].type == 8 && rochild[i].value != null) + { + string filename = rochild[i].value; + filename = filename.Substring(0, filename.IndexOf('\n')); + if (ChangedFiles.Contains(filename)) + roids.Add(rochild[i].roid); + } + if (rochild[i].children != null) FindChangedFiles(rochild[i].children, ChangedFiles, roids); } - if (rochild[i].children != null) FindChangedFiles(rochild[i].children,ChangedFiles, roids); } } /// @@ -411,6 +414,7 @@ namespace VEPROMS.CSLA.Library /// List of Files which have changed (DTS) private static List GetChangedFigures(ROFstInfo origROFst, ROFstInfo rofst) { + if (origROFst.ROFstFigures == null) return null; Dictionary orig = new Dictionary(); foreach (FigureInfo fi in origROFst.ROFstFigures) { @@ -463,6 +467,7 @@ namespace VEPROMS.CSLA.Library List delList = new List(); List chgList = newLU.GetValueDifferences(origLU, ref delList); // Any figures which have been changed will be included in the list of values that have changed. + if (MyChangedFigureROIDs != null) foreach (string roid in MyChangedFigureROIDs) if (!chgList.Contains(roid)) chgList.Add(roid); @@ -522,7 +527,7 @@ namespace VEPROMS.CSLA.Library foreach (string chg in chgList) { string padroid = chg.Length <= 12 ? chg + "0000" : chg; - if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating DRO Values"); + if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values"); if (activeDRoids.Contains(chg.Substring(0, 12))) { ROFSTLookup.rochild roch = newLU.GetRoChild(chg); @@ -587,7 +592,7 @@ namespace VEPROMS.CSLA.Library { foreach (DROUsageInfo droUsg in Daffected) { - if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old DRO Values"); + if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values"); Pdf.DeleteAll(droUsg.DocID); } }