修复语音对讲接口空指针异常

This commit is contained in:
648540858
2024-10-16 17:53:14 +08:00
parent 2492b0d638
commit cbd6a57e15
4 changed files with 14 additions and 13 deletions

View File

@@ -211,11 +211,12 @@ public class PlayController {
if (device == null) {
throw new ControllerException(ErrorCode.ERROR400.getCode(), "未找到设备: " + deviceId);
}
if (channelId == null) {
DeviceChannel channel = deviceChannelService.getOneForSource(device.getId(), channelId);
if (channel == null) {
throw new ControllerException(ErrorCode.ERROR400.getCode(), "未找到通道: " + channelId);
}
return playService.audioBroadcast(device, channelId, broadcastMode);
return playService.audioBroadcast(device, channel, broadcastMode);
}