We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88ac7e3 commit 87a9631Copy full SHA for 87a9631
packages/https/platforms/android/java/com/nativescript/https/CacheUtils.java
@@ -1,18 +1,26 @@
1
package com.nativescript.https;
2
3
+import java.util.Iterator;
4
import okhttp3.Cache;
5
6
public class CacheUtils {
7
public static void removeCachedResponse(String url, Cache cache) {
- final Iterator<String> it = cache.urls();
8
+ Iterator<String> it;
9
+ try {
10
+ it = cache.urls();
11
+ } catch (Exception e) {
12
+ it = null;
13
+ }
14
+
15
+ if (it != null) {
16
+ while (it.hasNext()) {
17
+ String cacheUrl = it.next();
18
- while (it.hasNext()) {
- String cacheUrl = it.next();
-
- if (cacheUrl.equals(url)) {
- it.remove();
- break;
19
+ if (cacheUrl.equals(url)) {
20
+ it.remove();
21
+ break;
22
23
}
24
25
-}
26
+}
0 commit comments