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:
parent
f076c23304
commit
c56c78f1e0
@ -770,8 +770,8 @@ namespace Volian.Controls.Library
|
||||
private ItemInfo TopPart(ItemInfo ii)
|
||||
{
|
||||
ExpandAsNeeded(ii);
|
||||
if (ii.Cautions != null) return TopPart(ii.Cautions[0]);
|
||||
if (ii.Notes != null) return TopPart(ii.Notes[0]);
|
||||
if (ii.Cautions != null && ii.Cautions.Count > 0) return TopPart(ii.Cautions[0]);
|
||||
if (ii.Notes != null && ii.Notes.Count > 0) return TopPart(ii.Notes[0]);
|
||||
return (ii);
|
||||
}
|
||||
/// <summary>
|
||||
@ -782,10 +782,10 @@ namespace Volian.Controls.Library
|
||||
private ItemInfo BottomPart(ItemInfo ii)
|
||||
{
|
||||
ExpandAsNeeded(ii);
|
||||
if (ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]);
|
||||
if (ii.Sections != null) return BottomPart(ii.Sections[0].LastSibling);
|
||||
if (ii.Steps != null) return BottomPart(ii.Steps[0].LastSibling);
|
||||
if (ii.Tables != null) return BottomPart(ii.Tables[0].LastSibling);
|
||||
if (ii.RNOs != null && ii.RNOs.Count > 0 && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]);
|
||||
if (ii.Sections != null && ii.Sections.Count > 0) return BottomPart(ii.Sections[0].LastSibling);
|
||||
if (ii.Steps != null && ii.Steps.Count > 0) return BottomPart(ii.Steps[0].LastSibling);
|
||||
if (ii.Tables != null && ii.Tables.Count > 0) return BottomPart(ii.Tables[0].LastSibling);
|
||||
return ii;
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user