1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 11:26:47 +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,9 +121,14 @@ public class FileManagementActivity extends AbstractGBActivity implements View.O
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (requestCode != REQUEST_CODE_PICK_UPLOAD_FILE) return; if (requestCode != REQUEST_CODE_PICK_UPLOAD_FILE) return;
if (resultCode != RESULT_OK) return; if (resultCode != RESULT_OK) return;
String fileName;
String fileName = AndroidUtils.getFilePath(this, data.getData()); try {
if (fileName == null) { 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; return;
} }