Added a check for the number of available Cautions and Notes in the TopPart() and BottomPart() functions to avoid an index out of range error.
This commit is contained in:
@@ -770,8 +770,8 @@ namespace Volian.Controls.Library
|
|||||||
private ItemInfo TopPart(ItemInfo ii)
|
private ItemInfo TopPart(ItemInfo ii)
|
||||||
{
|
{
|
||||||
ExpandAsNeeded(ii);
|
ExpandAsNeeded(ii);
|
||||||
if (ii.Cautions != null) return TopPart(ii.Cautions[0]);
|
if (ii.Cautions != null && ii.Cautions.Count > 0) return TopPart(ii.Cautions[0]);
|
||||||
if (ii.Notes != null) return TopPart(ii.Notes[0]);
|
if (ii.Notes != null && ii.Notes.Count > 0) return TopPart(ii.Notes[0]);
|
||||||
return (ii);
|
return (ii);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -782,10 +782,10 @@ namespace Volian.Controls.Library
|
|||||||
private ItemInfo BottomPart(ItemInfo ii)
|
private ItemInfo BottomPart(ItemInfo ii)
|
||||||
{
|
{
|
||||||
ExpandAsNeeded(ii);
|
ExpandAsNeeded(ii);
|
||||||
if (ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]);
|
if (ii.RNOs != null && ii.RNOs.Count > 0 && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]);
|
||||||
if (ii.Sections != null) return BottomPart(ii.Sections[0].LastSibling);
|
if (ii.Sections != null && ii.Sections.Count > 0) return BottomPart(ii.Sections[0].LastSibling);
|
||||||
if (ii.Steps != null) return BottomPart(ii.Steps[0].LastSibling);
|
if (ii.Steps != null && ii.Steps.Count > 0) return BottomPart(ii.Steps[0].LastSibling);
|
||||||
if (ii.Tables != null) return BottomPart(ii.Tables[0].LastSibling);
|
if (ii.Tables != null && ii.Tables.Count > 0) return BottomPart(ii.Tables[0].LastSibling);
|
||||||
return ii;
|
return ii;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user