Ver código fonte

加强判断

Pq 1 ano atrás
pai
commit
587709931e

+ 1 - 0
student/src/main/java/com/cooleshow/student/ui/web/AccompanyActivity.java

@@ -347,6 +347,7 @@ public class AccompanyActivity extends BaseMVPActivity<ActivityAccompanyBinding,
 
     private void goAdjustMusic(String recordId, String title, String coverImg) {
         if (TextUtils.isEmpty(accompanimentUrl)) {
+            ToastUtil.getInstance().showShort("无法找到伴奏文件");
             return;
         }
         String recordFilePath = MyFileUtils.getRecordFilePath();

+ 1 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/web/AccompanyActivity.java

@@ -305,6 +305,7 @@ public class AccompanyActivity extends BaseMVPActivity<ActivityAccompanyBinding,
 
     private void goAdjustMusic(String recordId, String title, String coverImg) {
         if (TextUtils.isEmpty(accompanimentUrl)) {
+            ToastUtil.getInstance().showShort("无法找到伴奏文件");
             return;
         }
         String recordFilePath = MyFileUtils.getRecordFilePath();

+ 1 - 1
teacher/src/main/java/com/cooleshow/teacher/widgets/helper/JsInterfaceAccomPanyUtils.java

@@ -322,7 +322,7 @@ public class JsInterfaceAccomPanyUtils extends Object {
                 if (TextUtils.equals("cloudAccompanyMessage", api)) {
                     JSONObject content = jsonObject.getJSONObject("content");
                     if (onListener != null) {
-                        String accompanyUrl = content.optString("accompanyUrl");
+                        String accompanyUrl = content.isNull("accompanyUrl") ? null : content.optString("accompanyUrl");
                         onListener.saveAccompanimentMp3(accompanyUrl);
                     }
                     return;