1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-03 08:52:58 +01:00

Add null pointer check based on Google Play store reports:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getPath()' on a null object reference
This commit is contained in:
Gordon Williams 2023-05-19 09:44:10 +01:00
parent 36d2fde49b
commit 0debd26a37

View File

@ -86,7 +86,7 @@ public class GpxReceiverActivity extends AbstractGBActivity {
if (documentUris != null) {
for (Uri uri : documentUris) {
if (uri.getPath().toLowerCase().endsWith(".gpx")) {
if (uri!=null && uri.getPath().toLowerCase().endsWith(".gpx")) {
FileToProcess file = new FileToProcess(uri);
fileList.add(file);
fileListingText.append(String.format("%s %s\n\n", file.name, file.exists ? getString(R.string.dbmanagementactivity_overwrite) : ""));