summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShen Lin <ishawn.lin@gmail.com>2016-12-09 11:06:29 +0800
committerShen Lin <ishawn.lin@gmail.com>2016-12-09 11:06:29 +0800
commit86c71b8458444dfcbf2c3919961b86bc92f65657 (patch)
treea3ae56ad0787f77b6ab7d2d6cd3023232539ebcc
parentd20f9d3f2375c0eed25dbb76288f611328dcd5ab (diff)
downloadvolley-86c71b8458444dfcbf2c3919961b86bc92f65657.tar.gz
Fix NegativeArraySizeException in DiskBasedCache.streamToBytes
Issue discussion can be found at https://groups.google.com/forum/#!topic/volley-users/0W-oI6za8VY
-rw-r--r--src/main/java/com/android/volley/toolbox/DiskBasedCache.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/android/volley/toolbox/DiskBasedCache.java b/src/main/java/com/android/volley/toolbox/DiskBasedCache.java
index c76d39a..f724d72 100644
--- a/src/main/java/com/android/volley/toolbox/DiskBasedCache.java
+++ b/src/main/java/com/android/volley/toolbox/DiskBasedCache.java
@@ -122,6 +122,10 @@ public class DiskBasedCache implements Cache {
VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
remove(key);
return null;
+ } catch (NegativeArraySizeException e) {
+ VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
+ remove(key);
+ return null;
} finally {
if (cis != null) {
try {