1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-22 08:13:43 +02:00

Verify that it's possible to get filename from old export

Fixes crash when trying to export to a files that has been removed.
This commit is contained in:
Erik Johansson
2018-02-28 18:49:12 +01:00
parent 4b40035895
commit 58639d4436

View File

@@ -604,6 +604,7 @@ public class MainActivity extends AppCompatActivity
String exportUri = prefs.getString(getExportPreferenceKey(selectedScaleUser), "");
uri = Uri.parse(exportUri);
getContentResolver().takePersistableUriPermission(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
openScale.getFilenameFromUri(uri);
}
catch (Exception ex) {
uri = null;