Commit 5b60b4a9cc1322feb6fb2ddf7dd337d18040350c
1 parent
a3a7ee80
文件选择判空处理
Showing
2 changed files
with
4 additions
and
1 deletions
filespicker/src/main/java/com/cnlive/filespicker/ui/model/FilePickerResult.java
| ... | ... | @@ -24,7 +24,7 @@ public class FilePickerResult implements Serializable { |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static FilePickerResult getPickerResult(Intent intent) { |
| 27 | - if(intent.getSerializableExtra(RESULT) != null){ | |
| 27 | + if(intent != null && intent.getSerializableExtra(RESULT) != null){ | |
| 28 | 28 | return (FilePickerResult) intent.getSerializableExtra(RESULT); |
| 29 | 29 | } |
| 30 | 30 | return null; | ... | ... |
updownfile/src/main/java/com/cnlive/updownfile/xiaoRay/DiretoryActivity.java
| ... | ... | @@ -553,6 +553,9 @@ public class DiretoryActivity extends AppCompatActivity implements View.OnClickL |
| 553 | 553 | Toast.makeText(this, "正在开始上传", Toast.LENGTH_LONG).show(); |
| 554 | 554 | break; |
| 555 | 555 | case 1009: |
| 556 | + if (data == null) { | |
| 557 | + return; | |
| 558 | + } | |
| 556 | 559 | FilePickerResult result = (FilePickerResult) FilePickerResult.getPickerResult(data); |
| 557 | 560 | ArrayList listss = new ArrayList(); |
| 558 | 561 | for (int i = 0; i < result.getFileList().size(); i++) { | ... | ... |