Fix part bug

pull/137/head
FongMi 4 years ago
parent 010cafe1ce
commit 874f47d576
  1. 9
      app/src/main/java/com/fongmi/android/tv/bean/Part.java

@ -6,6 +6,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Part {
@ -14,8 +15,12 @@ public class Part {
private String t;
private static List<Part> arrayFrom(String str) {
Type listType = new TypeToken<ArrayList<Part>>() {}.getType();
return new Gson().fromJson(str, listType);
try {
Type listType = new TypeToken<ArrayList<Part>>() {}.getType();
return new Gson().fromJson(str, listType);
} catch (Exception e) {
return Collections.emptyList();
}
}
public static List<String> get(String str) {

Loading…
Cancel
Save