danikula / AndroidVideoCache

Cache support for any video player with help of single line
Apache License 2.0
5.43k stars 1.16k forks source link

Starts Caching then tries to close the connection and throws NullPointerException #32

Closed atabouraya closed 8 years ago

atabouraya commented 9 years ago

I'm Using version 2.3.3

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int com.android.okio.Segment.limit' on a null object reference
       at com.android.okio.OkBuffer.write(OkBuffer.java:574)
       at com.android.okio.OkBuffer.read(OkBuffer.java:610)
       at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:53)
       at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:442)
       at com.android.okhttp.internal.Util.skipAll(Util.java:227)
       at com.android.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:212)
       at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.close(HttpConnection.java:464)
       at com.android.okhttp.internal.Util.closeQuietly(Util.java:97)
       at com.android.okhttp.internal.http.HttpEngine.close(HttpEngine.java:433)
       at com.android.okhttp.internal.http.HttpURLConnectionImpl.disconnect(HttpURLConnectionImpl.java:113)
       at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.disconnect(DelegatingHttpsURLConnection.java:93)
       at com.android.okhttp.internal.http.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:25)
       at com.danikula.videocache.HttpUrlSource.close(HttpUrlSource.java:79)
       at com.danikula.videocache.ProxyCache.closeSource(ProxyCache.java:159)
       at com.danikula.videocache.ProxyCache.readSource(ProxyCache.java:140)
       at com.danikula.videocache.ProxyCache.access$100(ProxyCache.java:19)
       at com.danikula.videocache.ProxyCache$SourceReaderRunnable.run(ProxyCache.java:178)
       at java.lang.Thread.run(Thread.java:818)
danikula commented 9 years ago

@atabouraya which android version this bug is reproduced on?

danikula commented 9 years ago

Issues duplicates this

atabouraya commented 9 years ago

API 21

danikula commented 8 years ago

Fixed here in version 2.3.4