mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Fix track when no maps folder is selected
This commit is contained in:
@@ -86,19 +86,19 @@ public final class MapsManager {
|
||||
AndroidGraphicFactory.createInstance(GBApplication.app());
|
||||
final GBPrefs prefs = GBApplication.getPrefs();
|
||||
|
||||
final DocumentFile[] documentFiles;
|
||||
final String folderUri = prefs.getString(PREF_MAPS_FOLDER, "");
|
||||
if (folderUri.isEmpty()) {
|
||||
return;
|
||||
if (!folderUri.isEmpty()) {
|
||||
final DocumentFile folder = DocumentFile.fromTreeUri(mContext, Uri.parse(folderUri));
|
||||
documentFiles = folder != null ? folder.listFiles() : new DocumentFile[0];
|
||||
} else {
|
||||
documentFiles = new DocumentFile[0];
|
||||
}
|
||||
|
||||
final DocumentFile folder = DocumentFile.fromTreeUri(mContext, Uri.parse(folderUri));
|
||||
LOG.debug("Got {} map files", documentFiles.length);
|
||||
|
||||
final MultiMapDataStore multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL);
|
||||
|
||||
final DocumentFile[] documentFiles = folder != null ? folder.listFiles() : new DocumentFile[0];
|
||||
|
||||
LOG.debug("Got {} map files", documentFiles.length);
|
||||
|
||||
for (final DocumentFile documentFile : documentFiles) {
|
||||
if (!documentFile.canRead()) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user