mirror of
https://github.com/zhigang1992/AndroidVideoCache.git
synced 2026-03-06 22:32:57 +08:00
Catch NullPointerException to avoid crash due to unsupported async disconnects on Android L (which uses an outdated okhttp version)
This commit is contained in:
committed by
Alexey Danilov
parent
0aad13f118
commit
33b7e5e9d3
@@ -76,7 +76,13 @@ public class HttpUrlSource implements Source {
|
||||
@Override
|
||||
public void close() throws ProxyCacheException {
|
||||
if (connection != null) {
|
||||
connection.disconnect();
|
||||
try {
|
||||
connection.disconnect();
|
||||
} catch (NullPointerException e) {
|
||||
// https://github.com/danikula/AndroidVideoCache/issues/32
|
||||
// https://github.com/danikula/AndroidVideoCache/issues/29
|
||||
throw new ProxyCacheException("Error disconnecting HttpUrlConnection", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user