Commit bcffdad7b68431c68b50ee74cad318656e85d8f5

Authored by 袁思汶
1 parent fe96d329

bundle判空异常处理

OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareMomentActivity.java
... ... @@ -322,9 +322,9 @@ public class ShareMomentActivity extends AppCompatActivity {
322 322 } else {
323 323 canNotDo();
324 324 }
325   - } else if (type.startsWith("image/") && bundle!=null) {
  325 + } else if (type.startsWith("image/")) {
326 326 //兼容QQ浏览器链接类型
327   - if (bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) {
  327 + if (bundle!=null && bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) {
328 328 String bundleText = bundle.get(TEXT) + "";
329 329 if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) {
330 330 String qqLink = bundleText.substring(bundleText.indexOf("http"));
... ... @@ -339,7 +339,7 @@ public class ShareMomentActivity extends AppCompatActivity {
339 339 shareConfig.shareRelease(context);
340 340 finish();
341 341 }
342   - } else if (bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题
  342 + } else if (bundle!=null && bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题
343 343 String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http"));
344 344 String weixin_title = bundle.get("weixin_title") + "";
345 345 String weixin_img_url = bundle.get("weixin_img_url") + "";
... ... @@ -398,8 +398,8 @@ public class ShareMomentActivity extends AppCompatActivity {
398 398 medialist.add(media);
399 399 jumpReleaseActivity(context, medialist, 3, "", "nocircle");
400 400 killTime();
401   - } else if ((equals ? preferences.getString("extratext", null) : bundle.get(TEXT)) != null &&
402   - bundle.get(TEXT) != null && !(bundle.get(TEXT) + "").contains("http")) { //腾讯文件Android Q
  401 + } else if (equals ? preferences.getString("extratext", null)!= null : (bundle!=null &&
  402 + bundle.get(TEXT) != null && !(bundle.get(TEXT) + "").contains("http"))) { //腾讯文件Android Q
403 403 String pathImg = getPath(context, imageUri);
404 404 Uri mediaUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
405 405 String[] projection = {MediaStore.Images.Media._ID,
... ... @@ -422,8 +422,7 @@ public class ShareMomentActivity extends AppCompatActivity {
422 422 killTime();
423 423 }
424 424 if (cursor != null) cursor.close();
425   - } else if ((equals ? preferences.getString("extratext", null) : bundle.get(TEXT)) != null &&
426   - bundle.get(TEXT) != null && (bundle.get(TEXT) + "").contains("http")) { // Q浏览器分享图片类型
  425 + } else if (equals ? preferences.getString("extratext", null) !=null : (bundle!=null && bundle.get(TEXT) != null && (bundle.get(TEXT) + "").contains("http"))) { // Q浏览器分享图片类型
427 426 String link = equals ? preferences.getString("extratext", "") : bundle.get(TEXT) + "";
428 427 if (link.contains("http") && !link.startsWith("http")) {
429 428 int begin = link.indexOf("http");
... ... @@ -471,7 +470,7 @@ public class ShareMomentActivity extends AppCompatActivity {
471 470 }
472 471 }
473 472 }
474   - } else if (type.startsWith("video/") && bundle!=null) {
  473 + } else if (type.startsWith("video/")) {
475 474 Uri videoUri = equals ? Uri.parse(preferences.getString("extrastream", "")) : bundle.getParcelable(Intent.EXTRA_STREAM);
476 475 if (videoUri == null) {
477 476 canNotDo();
... ...
config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "1.0.2.8",
  24 + version: "1.0.2.9",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.outside_share",
27 27 //Lib库名称
... ...