Don't allow invalid values for header/footer insertion point
This commit is contained in:
parent
4e21f049d3
commit
1266c3c73e
1 changed files with 11 additions and 2 deletions
|
@ -32,11 +32,20 @@ class InsertableHtmlContent implements Serializable {
|
|||
}
|
||||
|
||||
public void setHeaderInsertionPoint(int headerInsertionPoint) {
|
||||
this.headerInsertionPoint = headerInsertionPoint;
|
||||
if (headerInsertionPoint < 0 || headerInsertionPoint > quotedContent.length()) {
|
||||
this.headerInsertionPoint = 0;
|
||||
} else {
|
||||
this.headerInsertionPoint = headerInsertionPoint;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFooterInsertionPoint(int footerInsertionPoint) {
|
||||
this.footerInsertionPoint = footerInsertionPoint;
|
||||
int len = quotedContent.length();
|
||||
if (footerInsertionPoint < 0 || footerInsertionPoint > len) {
|
||||
this.footerInsertionPoint = len;
|
||||
} else {
|
||||
this.footerInsertionPoint = footerInsertionPoint;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue