1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 03:16:51 +01:00

Fossil Hybrid HR: prevent hard crash when choosing a remote URL in FIle Mananger

This commit is contained in:
Andreas Shimokawa 2021-03-13 22:00:12 +01:00
parent 2d17f06d6d
commit 91b27901e7

View File

@ -121,11 +121,16 @@ public class FileManagementActivity extends AbstractGBActivity implements View.O
super.onActivityResult(requestCode, resultCode, data);
if (requestCode != REQUEST_CODE_PICK_UPLOAD_FILE) return;
if (resultCode != RESULT_OK) return;
String fileName = AndroidUtils.getFilePath(this, data.getData());
String fileName;
try {
fileName = AndroidUtils.getFilePath(this, data.getData());
if (fileName == null) {
return;
}
} catch (IllegalArgumentException e) {
GB.toast("please choose a local file", Toast.LENGTH_LONG, GB.WARN);
return;
}
try {
if (!warningDisplayed) {