1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-08-24 00:00:47 +02: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) : ""));