修复通道解析可能的空指针异常
parent
ebeaee419f
commit
9828063bb0
|
@ -104,7 +104,10 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
event = eventElement.getText().toUpperCase();
|
event = eventElement.getText().toUpperCase();
|
||||||
}
|
}
|
||||||
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event, civilCodeFileConf);
|
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event, civilCodeFileConf);
|
||||||
|
if (channel == null) {
|
||||||
|
logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
channel.setDeviceId(device.getDeviceId());
|
channel.setDeviceId(device.getDeviceId());
|
||||||
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId());
|
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId());
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
|
|
@ -408,6 +408,10 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
event = eventElement.getText().toUpperCase();
|
event = eventElement.getText().toUpperCase();
|
||||||
}
|
}
|
||||||
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event, civilCodeFileConf);
|
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event, civilCodeFileConf);
|
||||||
|
if (channel == null) {
|
||||||
|
logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
channel.setDeviceId(device.getDeviceId());
|
channel.setDeviceId(device.getDeviceId());
|
||||||
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId());
|
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId());
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
|
|
@ -113,6 +113,10 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DeviceChannel deviceChannel = XmlUtil.channelContentHandler(itemDevice, device, null, civilCodeFileConf);
|
DeviceChannel deviceChannel = XmlUtil.channelContentHandler(itemDevice, device, null, civilCodeFileConf);
|
||||||
|
if (deviceChannel == null) {
|
||||||
|
logger.info("[收到通道]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
deviceChannel = SipUtils.updateGps(deviceChannel, device.getGeoCoordSys());
|
deviceChannel = SipUtils.updateGps(deviceChannel, device.getGeoCoordSys());
|
||||||
deviceChannel.setDeviceId(take.getDevice().getDeviceId());
|
deviceChannel.setDeviceId(take.getDevice().getDeviceId());
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,10 @@ public class SipUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DeviceChannel updateGps(DeviceChannel deviceChannel, String geoCoordSys) {
|
public static DeviceChannel updateGps(DeviceChannel deviceChannel, String geoCoordSys) {
|
||||||
|
if (deviceChannel == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) {
|
if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) {
|
||||||
|
|
||||||
if (geoCoordSys == null) {
|
if (geoCoordSys == null) {
|
||||||
|
|
Loading…
Reference in New Issue