diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInfoSearchExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInfoSearchExt.cs index 0e92f5e3..fbc07298 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInfoSearchExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInfoSearchExt.cs @@ -15,14 +15,14 @@ namespace VEPROMS.CSLA.Library } private ItemInfo SearchNextSkip(SkipPartType skip) { - if (skip < SkipPartType.Caution && Cautions != null) return Cautions[0].SearchTop; - if (skip < SkipPartType.Note && Notes != null) return Notes[0].SearchTop; + if (skip < SkipPartType.Caution && Cautions != null && Cautions.Count > 0) return Cautions[0].SearchTop; + if (skip < SkipPartType.Note && Notes != null && Notes.Count > 0) return Notes[0].SearchTop; if (skip < SkipPartType.This) return this; - if (skip < SkipPartType.RNO && RNOs != null) return RNOs[0].SearchTop; - if (skip < SkipPartType.Table && Tables != null) return Tables[0].SearchTop; - if (skip < SkipPartType.Procedures && Procedures != null) return Procedures[0].SearchTop; - if (skip < SkipPartType.Sections && Sections != null) return Sections[0].SearchTop; - if (skip < SkipPartType.Steps && Steps != null) return Steps[0].SearchTop; + if (skip < SkipPartType.RNO && RNOs != null && RNOs.Count > 0) return RNOs[0].SearchTop; + if (skip < SkipPartType.Table && Tables != null && Tables.Count > 0) return Tables[0].SearchTop; + if (skip < SkipPartType.Procedures && Procedures != null && Procedures.Count > 0) return Procedures[0].SearchTop; + if (skip < SkipPartType.Sections && Sections != null && Sections.Count > 0) return Sections[0].SearchTop; + if (skip < SkipPartType.Steps && Steps != null && Steps.Count > 0) return Steps[0].SearchTop; if (NextItem != null) return NextItem.SearchTop; return UpOneNext; }