返回null

This commit is contained in:
2025-06-02 09:42:31 +08:00
parent 26a9be80f6
commit 89e112e13a

View File

@ -247,13 +247,17 @@ public class BceFaceBodyAdapter implements IFaceBodyAdapter {
if (response.getInt("error_code") == 0) { if (response.getInt("error_code") == 0) {
JSONObject resultObj = response.getJSONObject("result"); JSONObject resultObj = response.getJSONObject("result");
if (resultObj != null) { if (resultObj != null) {
JSONArray faceList = resultObj.getJSONArray("face_list"); try {
List<String> result = new ArrayList<>(); JSONArray faceList = resultObj.getJSONArray("face_list");
for (int i = 0; i < faceList.length(); i++) { List<String> result = new ArrayList<>();
JSONObject jsonObject = faceList.getJSONObject(i); for (int i = 0; i < faceList.length(); i++) {
result.add(jsonObject.getString("face_token")); JSONObject jsonObject = faceList.getJSONObject(i);
result.add(jsonObject.getString("face_token"));
}
return result;
} catch (Exception e) {
return Collections.emptyList();
} }
return result;
} else { } else {
return Collections.emptyList(); return Collections.emptyList();
} }