Commit 9ba9446f by lzy

空指针

parent 8fe7fbd9
......@@ -56,8 +56,10 @@ public class DemoProductDeviceService extends DemoCommonService {
try {
DemoResponseMessage responseMessage = sendPost(url, request);
if (responseMessage.getRetcode() == 0) {
DemoDeviceEntity demoDeviceEntities = JSON.parseObject(responseMessage.getData().toString(),DemoDeviceEntity.class);
return demoDeviceEntities;
if(responseMessage.getData() != null){
DemoDeviceEntity demoDeviceEntities = JSON.parseObject(responseMessage.getData().toString(),DemoDeviceEntity.class);
return demoDeviceEntities;
}
}
log.error("获取设备接口失败:{}", responseMessage.getMsg());
} catch (IOException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment