|
@@ -73,7 +73,7 @@ public class SpeakerController {
|
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
|
JSONObject extra=jsonArray.getJSONObject(i).getJSONObject("extra");
|
|
JSONObject extra=jsonArray.getJSONObject(i).getJSONObject("extra");
|
|
|
JSONObject obj = extra.getJSONObject("config");
|
|
JSONObject obj = extra.getJSONObject("config");
|
|
|
- if(obj.getString("mac").equals(map.getOrDefault("hardwareNum","").toString())){
|
|
|
|
|
|
|
+ if(!Objects.isNull(obj) && obj.getString("mac").equals(map.getOrDefault("hardwareNum","").toString())){
|
|
|
map.put("deviceSn",obj.getString("sn"));
|
|
map.put("deviceSn",obj.getString("sn"));
|
|
|
map.put("deviceIp",extra.getString("ip"));
|
|
map.put("deviceIp",extra.getString("ip"));
|
|
|
map.put("operate",extra.getString("online"));
|
|
map.put("operate",extra.getString("online"));
|
|
@@ -111,7 +111,7 @@ public class SpeakerController {
|
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
|
JSONObject extra=jsonArray.getJSONObject(i).getJSONObject("extra");
|
|
JSONObject extra=jsonArray.getJSONObject(i).getJSONObject("extra");
|
|
|
JSONObject obj = extra.getJSONObject("config");
|
|
JSONObject obj = extra.getJSONObject("config");
|
|
|
- if(obj.getString("mac").equals(map.getOrDefault("hardwareNum","").toString())){
|
|
|
|
|
|
|
+ if(!Objects.isNull(obj) && obj.getString("mac").equals(map.getOrDefault("hardwareNum","").toString())){
|
|
|
map.put("deviceSn",obj.getString("sn"));
|
|
map.put("deviceSn",obj.getString("sn"));
|
|
|
map.put("deviceIp",extra.getString("ip"));
|
|
map.put("deviceIp",extra.getString("ip"));
|
|
|
map.put("operate",extra.getString("online"));
|
|
map.put("operate",extra.getString("online"));
|