Do nothing in ImapConnection.close() if connection is not open
Under certain circumstances ImapFolderPusher can call ImapConnection.close() twice. When using compression this will lead to a NullPointerException inside ZOutputStream.close(). We're ignoring all exceptions when closing a connection. So this shouldn't be a problem. But (early versions of?) Android 8.1 shipped with a bug in ART that shuts down the VM when a NullPointerException is triggered from AOT/JIT(?) compiled code that uses a certain optimization. And we're unlucky enough to trigger this bug. Not closing the streams more than once should work around this bug. See issue #2931
This commit is contained in:
parent
a95e897803
commit
c2eb00b4f6
1 changed files with 4 additions and 0 deletions
|
@ -715,6 +715,10 @@ class ImapConnection {
|
|||
}
|
||||
|
||||
public void close() {
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
|
||||
open = false;
|
||||
stacktraceForClose = new Exception();
|
||||
|
||||
|
|
Loading…
Reference in a new issue