Skip to content

Commit 87a9631

Browse files
authored
fix: Compiler warnings
1 parent 88ac7e3 commit 87a9631

File tree

1 file changed

+16
-8
lines changed
  • packages/https/platforms/android/java/com/nativescript/https

1 file changed

+16
-8
lines changed
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
package com.nativescript.https;
22

3+
import java.util.Iterator;
34
import okhttp3.Cache;
45

56
public class CacheUtils {
67
public static void removeCachedResponse(String url, Cache cache) {
7-
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();
818

9-
while (it.hasNext()) {
10-
String cacheUrl = it.next();
11-
12-
if (cacheUrl.equals(url)) {
13-
it.remove();
14-
break;
19+
if (cacheUrl.equals(url)) {
20+
it.remove();
21+
break;
22+
}
1523
}
1624
}
1725
}
18-
}
26+
}

0 commit comments

Comments
 (0)