mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-12 04:25:08 -05:00
Don't allow invalid values for header/footer insertion point
This commit is contained in:
parent
4e21f049d3
commit
1266c3c73e
@ -32,12 +32,21 @@ class InsertableHtmlContent implements Serializable {
|
||||
}
|
||||
|
||||
public void setHeaderInsertionPoint(int headerInsertionPoint) {
|
||||
if (headerInsertionPoint < 0 || headerInsertionPoint > quotedContent.length()) {
|
||||
this.headerInsertionPoint = 0;
|
||||
} else {
|
||||
this.headerInsertionPoint = headerInsertionPoint;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFooterInsertionPoint(int footerInsertionPoint) {
|
||||
int len = quotedContent.length();
|
||||
if (footerInsertionPoint < 0 || footerInsertionPoint > len) {
|
||||
this.footerInsertionPoint = len;
|
||||
} else {
|
||||
this.footerInsertionPoint = footerInsertionPoint;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quoted content.
|
||||
|
Loading…
Reference in New Issue
Block a user