Update Doh.java

pull/123/head
FongMi 3 years ago
parent d259aa0766
commit 84d5e54954
  1. 6
      catvod/src/main/java/com/github/catvod/bean/Doh.java

@ -36,8 +36,7 @@ public class Doh {
}
public static List<Doh> arrayFrom(JsonElement element) {
Type listType = new TypeToken<List<Doh>>() {
}.getType();
Type listType = new TypeToken<List<Doh>>() {}.getType();
List<Doh> items = new Gson().fromJson(element, listType);
return items == null ? new ArrayList<>() : items;
}
@ -61,10 +60,9 @@ public class Doh {
public List<InetAddress> getHosts() {
try {
if (getIps().isEmpty()) return null;
List<InetAddress> list = new ArrayList<>();
for (String ip : getIps()) list.add(InetAddress.getByName(ip));
return list;
return list.isEmpty() ? null : list;
} catch (Exception ignored) {
return null;
}

Loading…
Cancel
Save