mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Don't allow invalid values for header/footer insertion point
This commit is contained in:
parent
4e21f049d3
commit
1266c3c73e
@ -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 New Issue
Block a user