Commit fe96d329d773722d0aeb337bf7fbb0b131eb00ec
1 parent
87176aed
bundle判空异常处理
Showing
2 changed files
with
5 additions
and
5 deletions
OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareMomentActivity.java
| @@ -322,9 +322,9 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -322,9 +322,9 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 322 | } else { | 322 | } else { |
| 323 | canNotDo(); | 323 | canNotDo(); |
| 324 | } | 324 | } |
| 325 | - } else if (type.startsWith("image/")) { | 325 | + } else if (type.startsWith("image/") && bundle!=null) { |
| 326 | //兼容QQ浏览器链接类型 | 326 | //兼容QQ浏览器链接类型 |
| 327 | - if (bundle!=null && bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) { | 327 | + if (bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) { |
| 328 | String bundleText = bundle.get(TEXT) + ""; | 328 | String bundleText = bundle.get(TEXT) + ""; |
| 329 | if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) { | 329 | if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) { |
| 330 | String qqLink = bundleText.substring(bundleText.indexOf("http")); | 330 | String qqLink = bundleText.substring(bundleText.indexOf("http")); |
| @@ -339,7 +339,7 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -339,7 +339,7 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 339 | shareConfig.shareRelease(context); | 339 | shareConfig.shareRelease(context); |
| 340 | finish(); | 340 | finish(); |
| 341 | } | 341 | } |
| 342 | - } else if (bundle!=null && bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题 | 342 | + } else if (bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题 |
| 343 | String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http")); | 343 | String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http")); |
| 344 | String weixin_title = bundle.get("weixin_title") + ""; | 344 | String weixin_title = bundle.get("weixin_title") + ""; |
| 345 | String weixin_img_url = bundle.get("weixin_img_url") + ""; | 345 | String weixin_img_url = bundle.get("weixin_img_url") + ""; |
| @@ -471,7 +471,7 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -471,7 +471,7 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 471 | } | 471 | } |
| 472 | } | 472 | } |
| 473 | } | 473 | } |
| 474 | - } else if (type.startsWith("video/")) { | 474 | + } else if (type.startsWith("video/") && bundle!=null) { |
| 475 | Uri videoUri = equals ? Uri.parse(preferences.getString("extrastream", "")) : bundle.getParcelable(Intent.EXTRA_STREAM); | 475 | Uri videoUri = equals ? Uri.parse(preferences.getString("extrastream", "")) : bundle.getParcelable(Intent.EXTRA_STREAM); |
| 476 | if (videoUri == null) { | 476 | if (videoUri == null) { |
| 477 | canNotDo(); | 477 | canNotDo(); |
config.gradle