修复域名查询bright cloud时cats信息为空报错
This commit is contained in:
@@ -106,10 +106,15 @@ public class BrightCloud {
|
||||
// json处理
|
||||
JSONObject queries = jo.getJSONObject("queries");
|
||||
JSONObject getInfo = queries.getJSONObject(bcConfig.getQueryType());
|
||||
|
||||
JSONObject cat = getInfo.getJSONArray("cats").getJSONObject(0);
|
||||
Integer catId = cat.getInteger("catid");
|
||||
String fqdn = jo.getString("url");
|
||||
int catId = 0;
|
||||
int catConf = 0;
|
||||
|
||||
if (getInfo.getJSONArray("cats") != null && getInfo.getJSONArray("cats").size() > 0) {
|
||||
JSONObject cat = getInfo.getJSONArray("cats").getJSONObject(0);
|
||||
catId = cat.getInteger("catid");
|
||||
catConf = cat.getInteger("conf");
|
||||
}
|
||||
domainFiles.add(new DomainCategory(
|
||||
fqdn,
|
||||
"brightcloud",
|
||||
@@ -120,8 +125,9 @@ public class BrightCloud {
|
||||
catId,
|
||||
getCatInfo(catId).get(0),
|
||||
getCatInfo(catId).get(1),
|
||||
cat.getInteger("conf"),
|
||||
catConf,
|
||||
getInfo.getBoolean("a1cat")));
|
||||
|
||||
}
|
||||
}
|
||||
return domainFiles;
|
||||
|
||||
Reference in New Issue
Block a user