1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Don't allow invalid values for header/footer insertion point

This commit is contained in:
cketti 2012-03-27 20:41:43 +02:00
parent 4e21f049d3
commit 1266c3c73e

View File

@ -32,12 +32,21 @@ class InsertableHtmlContent implements Serializable {
} }
public void setHeaderInsertionPoint(int headerInsertionPoint) { public void setHeaderInsertionPoint(int headerInsertionPoint) {
if (headerInsertionPoint < 0 || headerInsertionPoint > quotedContent.length()) {
this.headerInsertionPoint = 0;
} else {
this.headerInsertionPoint = headerInsertionPoint; this.headerInsertionPoint = headerInsertionPoint;
} }
}
public void setFooterInsertionPoint(int footerInsertionPoint) { public void setFooterInsertionPoint(int footerInsertionPoint) {
int len = quotedContent.length();
if (footerInsertionPoint < 0 || footerInsertionPoint > len) {
this.footerInsertionPoint = len;
} else {
this.footerInsertionPoint = footerInsertionPoint; this.footerInsertionPoint = footerInsertionPoint;
} }
}
/** /**
* Get the quoted content. * Get the quoted content.