Prevent crash

This commit is contained in:
M66B 2020-07-10 14:43:33 +02:00
parent 3777412b79
commit 1d1b42d192
1 changed files with 4 additions and 4 deletions

View File

@ -305,7 +305,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
return found; return found;
} }
private int load_server(State state) throws MessagingException, IOException { private int load_server(final State state) throws MessagingException, IOException {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
@ -413,12 +413,12 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
if (protocol.supportsUtf8()) if (protocol.supportsUtf8())
try { try {
return search(true, browsable.keywords, protocol); return search(true, browsable.keywords, protocol, state);
} catch (Throwable ex) { } catch (Throwable ex) {
EntityLog.log(context, ex.toString()); EntityLog.log(context, ex.toString());
} }
return search(false, browsable.keywords, protocol); return search(false, browsable.keywords, protocol, state);
} }
} catch (Throwable ex) { } catch (Throwable ex) {
ProtocolException pex = new ProtocolException( ProtocolException pex = new ProtocolException(
@ -531,7 +531,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
return found; return found;
} }
private Message[] search(boolean utf8, String[] keywords, IMAPProtocol protocol) throws IOException, MessagingException, ProtocolException { private Message[] search(boolean utf8, String[] keywords, IMAPProtocol protocol, State state) throws IOException, MessagingException, ProtocolException {
EntityLog.log(context, "Search utf8=" + utf8); EntityLog.log(context, "Search utf8=" + utf8);
SearchTerm terms = criteria.getTerms(utf8, state.ifolder.getPermanentFlags(), keywords); SearchTerm terms = criteria.getTerms(utf8, state.ifolder.getPermanentFlags(), keywords);