forked from j62/ctbrec
Fix: BongaCams search fails with JSON exceptions
This commit is contained in:
parent
2a1dc77a89
commit
6dd7de9762
|
@ -157,6 +157,7 @@ public class BongaCams extends AbstractSite {
|
||||||
JSONArray results = json.getJSONArray("models");
|
JSONArray results = json.getJSONArray("models");
|
||||||
for (int i = 0; i < results.length(); i++) {
|
for (int i = 0; i < results.length(); i++) {
|
||||||
JSONObject result = results.getJSONObject(i);
|
JSONObject result = results.getJSONObject(i);
|
||||||
|
if(result.has("username")) {
|
||||||
Model model = createModel(result.getString("username"));
|
Model model = createModel(result.getString("username"));
|
||||||
String thumb = result.getString("thumb_image");
|
String thumb = result.getString("thumb_image");
|
||||||
if(thumb != null) {
|
if(thumb != null) {
|
||||||
|
@ -167,6 +168,7 @@ public class BongaCams extends AbstractSite {
|
||||||
}
|
}
|
||||||
models.add(model);
|
models.add(model);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return models;
|
return models;
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("Search result: " + json.toString(2));
|
LOG.warn("Search result: " + json.toString(2));
|
||||||
|
|
Loading…
Reference in New Issue