diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index af220bba6..0ac8be711 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -104,6 +104,7 @@ + + + upload-z0.qiniup.com + + \ No newline at end of file diff --git a/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java b/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java index af19dc222..0f4f31185 100644 --- a/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java +++ b/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java @@ -54,14 +54,29 @@ public class UploadQnImpl implements UploadStrategy { public void complete(String key, ResponseInfo info, JSONObject response) { System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null)); //L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null)); - try { + /* try { assert response != null; mList.get(mIndex).setRemoteAccessUrl(response.getString("key")); } catch (JSONException e) { // throw new RuntimeException(e); L.e(e); return; + }*/ + + if (response == null) { + // Handle the null case, e.g., log an error, throw a specific exception, etc. + L.e("Response is null"); + return; } + try { + mList.get(mIndex).setRemoteAccessUrl(response.getString("key")); + } catch (JSONException e) { + L.e(e); + return; + } + + + if (mList == null || mList.size() == 0) { if (mUploadCallback != null) { mUploadCallback.onFinish(mList, false);