Fix two rare crashes from bad input / state

This commit is contained in:
Sean Owen 2015-09-22 22:24:30 +01:00
parent 55b7c3e763
commit e0ea32f217
2 changed files with 6 additions and 2 deletions

View file

@ -46,7 +46,7 @@ final class BookmarkAdapter extends BaseAdapter {
@Override
public int getCount() {
return cursor.getCount();
return cursor.isClosed() ? 0 : cursor.getCount();
}
@Override

View file

@ -41,7 +41,11 @@ public final class EmailAddressResultParser extends ResultParser {
if (queryStart >= 0) {
hostEmail = hostEmail.substring(0, queryStart);
}
hostEmail = urlDecode(hostEmail);
try {
hostEmail = urlDecode(hostEmail);
} catch (IllegalArgumentException iae) {
return null;
}
String[] tos = null;
if (!hostEmail.isEmpty()) {
tos = COMMA.split(hostEmail);