Avoid NullPointer in creating photoUrl when importing

This commit is contained in:
Román
2020-04-09 11:34:52 +02:00
committed by Dennis Guse
parent 1b69f29751
commit 7bf153db39
2 changed files with 2 additions and 2 deletions
@@ -378,7 +378,7 @@ abstract class AbstractFileTrackImporter extends DefaultHandler implements Track
Uri photoUri = FileUtils.getUriForFile(context, file);
return photoUri.toString();
return "" + photoUri;
}
/**
@@ -186,7 +186,7 @@ public class KmlFileTrackImporter extends AbstractFileTrackImporter {
return;
}
// If there is photoUrl it has to be changed because that url in kml file isn't a valid content:// to the imported one.
// If there is photoUrl it has to be changed because that url in kml file is a relative path to the internal kmz file.
if (photoUrl != null) {
photoUrl = getPhotoUrl(Uri.parse(photoUrl).getLastPathSegment());
}