Commit a3d871022c68053ed5fa2c3d213fca7ec4d2136d
1 parent
48a1a247
修复空指针异常
Showing
1 changed file
with
23 additions
and
6 deletions
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
| @@ -120,17 +120,34 @@ public class ApiStreamController { | @@ -120,17 +120,34 @@ public class ApiStreamController { | ||
| 120 | result.put("ChannelName", deviceChannel.getName()); | 120 | result.put("ChannelName", deviceChannel.getName()); |
| 121 | result.put("ChannelCustomName", ""); | 121 | result.put("ChannelCustomName", ""); |
| 122 | result.put("FLV", streamInfo.getFlv().getUrl()); | 122 | result.put("FLV", streamInfo.getFlv().getUrl()); |
| 123 | - result.put("HTTPS_FLV", streamInfo.getHttps_flv().getUrl()); | 123 | + if (streamInfo.getHttps_flv() != null) { |
| 124 | + result.put("HTTPS_FLV", streamInfo.getHttps_flv().getUrl()); | ||
| 125 | + } | ||
| 126 | + | ||
| 124 | result.put("WS_FLV", streamInfo.getWs_flv().getUrl()); | 127 | result.put("WS_FLV", streamInfo.getWs_flv().getUrl()); |
| 125 | - result.put("WSS_FLV", streamInfo.getWss_flv().getUrl()); | 128 | + if (streamInfo.getWss_flv() != null) { |
| 129 | + result.put("WSS_FLV", streamInfo.getWss_flv().getUrl()); | ||
| 130 | + } | ||
| 131 | + | ||
| 126 | result.put("RTMP", streamInfo.getRtmp().getUrl()); | 132 | result.put("RTMP", streamInfo.getRtmp().getUrl()); |
| 127 | - result.put("RTMPS", streamInfo.getRtmps().getUrl()); | 133 | + if (streamInfo.getRtmps() != null) { |
| 134 | + result.put("RTMPS", streamInfo.getRtmps().getUrl()); | ||
| 135 | + } | ||
| 136 | + | ||
| 128 | result.put("HLS", streamInfo.getHls().getUrl()); | 137 | result.put("HLS", streamInfo.getHls().getUrl()); |
| 129 | - result.put("HTTPS_HLS", streamInfo.getHttps_hls().getUrl()); | 138 | + if (streamInfo.getHttps_hls() != null) { |
| 139 | + result.put("HTTPS_HLS", streamInfo.getHttps_hls().getUrl()); | ||
| 140 | + } | ||
| 130 | result.put("RTSP", streamInfo.getRtsp().getUrl()); | 141 | result.put("RTSP", streamInfo.getRtsp().getUrl()); |
| 131 | - result.put("RTSPS", streamInfo.getRtsps().getUrl()); | 142 | + if (streamInfo.getRtsps() != null) { |
| 143 | + result.put("RTSPS", streamInfo.getRtsps().getUrl()); | ||
| 144 | + } | ||
| 145 | + | ||
| 132 | result.put("WEBRTC", streamInfo.getRtc().getUrl()); | 146 | result.put("WEBRTC", streamInfo.getRtc().getUrl()); |
| 133 | - result.put("HTTPS_WEBRTC", streamInfo.getRtcs().getUrl()); | 147 | + if (streamInfo.getRtcs() != null) { |
| 148 | + result.put("HTTPS_WEBRTC", streamInfo.getRtcs().getUrl()); | ||
| 149 | + } | ||
| 150 | + | ||
| 134 | result.put("CDN", ""); | 151 | result.put("CDN", ""); |
| 135 | result.put("SnapURL", ""); | 152 | result.put("SnapURL", ""); |
| 136 | result.put("Transport", device.getTransport()); | 153 | result.put("Transport", device.getTransport()); |