forked from upstream-mirrors/OpenTracks
Avoid NullPointer in creating photoUrl when importing
This commit is contained in:
+1
-1
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user