From 646f805b9998bc9c7dc4e413fa2f7d91d52503b3 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 29 May 2024 18:36:51 +0200 Subject: [PATCH 1/2] protect exception --- .../src/main/java/btools/routingapp/BImportActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BImportActivity.java b/brouter-routing-app/src/main/java/btools/routingapp/BImportActivity.java index 2550bf9..0cd981e 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BImportActivity.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BImportActivity.java @@ -73,13 +73,19 @@ public class BImportActivity extends AppCompatActivity { // URI example ==> dat=content://me.bluemail.mail.attachmentprovider/a2939069-76b5-44e4-8cbd-94485d0fd4ff/cc32b61d-97a6-4871-b67f-945d1d1d43c8/VIEW String filename = null; long filesize = 0L; + try (Cursor cursor = this.getContentResolver().query(intent.getData(), new String[]{ OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE}, null, null, null)) { if (cursor != null && cursor.moveToFirst()) { filename = cursor.getString(cursor.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME)); filesize = cursor.getLong(cursor.getColumnIndexOrThrow(OpenableColumns.SIZE)); } + } catch (Exception e) { + resultMessage.append("ERROR: File not accessible\n"); + displayMessage(resultMessage.toString()); + return; } + // is the file extention ".brf" in the file name if (filename == null || isInvalidProfileFilename(filename)) { resultMessage.append("ERROR: File extention must be \".brf\"\n"); From 2a77f71c85ab88d3a9ebe3dba99d812a869afa3c Mon Sep 17 00:00:00 2001 From: afischerdev Date: Wed, 29 May 2024 18:38:31 +0200 Subject: [PATCH 2/2] updated doc --- docs/revisions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/revisions.md b/docs/revisions.md index a520dd0..95b53d6 100644 --- a/docs/revisions.md +++ b/docs/revisions.md @@ -17,6 +17,9 @@ Profiles - update gravel profile + +- Minor bug fixes + [Solved issues](https://github.com/abrensch/brouter/issues?q=is%3Aissue+milestone%3A%22Version+1.7.5%22+is%3Aclosed)