浏览代码

音量调节入参为null处理

zouxuan 3 年之前
父节点
当前提交
ed59b667b1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

+ 2 - 2
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -832,14 +832,14 @@ public class RoomServiceImpl implements RoomService {
             enable = data.getMusicScoreOn();
             if(enable){
                 //保存伴奏音量
-                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume());
+                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume()==null?0:data.getSoundVolume());
             }
         }else if (data.getAccompanimentOn() != null) {
             typeEnum = DeviceTypeEnum.MusicScoreAccompaniment;
             enable = data.getAccompanimentOn();
             if(enable){
                 //保存伴奏音量
-                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume());
+                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume()==null?0:data.getSoundVolume());
             }
         } else {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);