Browse Source

音量调节入参为null处理

zouxuan 3 years ago
parent
commit
ed59b667b1
1 changed files with 2 additions and 2 deletions
  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();
             enable = data.getMusicScoreOn();
             if(enable){
             if(enable){
                 //保存伴奏音量
                 //保存伴奏音量
-                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume());
+                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume()==null?0:data.getSoundVolume());
             }
             }
         }else if (data.getAccompanimentOn() != null) {
         }else if (data.getAccompanimentOn() != null) {
             typeEnum = DeviceTypeEnum.MusicScoreAccompaniment;
             typeEnum = DeviceTypeEnum.MusicScoreAccompaniment;
             enable = data.getAccompanimentOn();
             enable = data.getAccompanimentOn();
             if(enable){
             if(enable){
                 //保存伴奏音量
                 //保存伴奏音量
-                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume());
+                roomDao.updateSoundVolumeById(roomId,data.getSoundVolume()==null?0:data.getSoundVolume());
             }
             }
         } else {
         } else {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);