Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
修复json格式书源无法导入的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuecanzhu committed Dec 6, 2021
1 parent 09b349c commit c28786f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent d
Single.create((SingleOnSubscribe<String>) emitter -> {
// String json = FileUtils.readInStream(DocumentUtil.getFileInputSteam(getContext(), data.getData()));
DocumentFile file = DocumentFile.fromSingleUri(getContext(), data.getData());
if (!file.getName().endsWith(".txt") && !file.getType().endsWith(".json")) {
if (!file.getName().endsWith(".txt") && !file.getName().endsWith(".json")) {
emitter.onError(new Throwable("文件格式错误"));
return;
}
Expand Down

0 comments on commit c28786f

Please sign in to comment.