forked from j62/ctbrec
Set online state to offline if model details cannot be loaded
This commit is contained in:
parent
55b219d271
commit
c543af6429
|
@ -64,6 +64,7 @@ public class Cam4Model extends AbstractModel {
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
JSONArray json = new JSONArray(response.body().string());
|
JSONArray json = new JSONArray(response.body().string());
|
||||||
if(json.length() == 0) {
|
if(json.length() == 0) {
|
||||||
|
onlineState = "offline";
|
||||||
throw new ModelDetailsEmptyException("Model details are empty");
|
throw new ModelDetailsEmptyException("Model details are empty");
|
||||||
}
|
}
|
||||||
JSONObject details = json.getJSONObject(0);
|
JSONObject details = json.getJSONObject(0);
|
||||||
|
|
Loading…
Reference in New Issue