Skip to content

Commit

Permalink
Avoid creation of empty Link in SharedUtil methods
Browse files Browse the repository at this point in the history
  • Loading branch information
RZR-UA committed Jan 16, 2025
1 parent 3b1026a commit 04683f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OsmAnd/src/net/osmand/plus/shared/SharedUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ object SharedUtil {
kPoint.lat = point.lat
kPoint.lon = point.lon
kPoint.name = point.name
kPoint.link = Link(point.link)
kPoint.category = point.category
kPoint.desc = point.desc
kPoint.comment = point.comment
Expand All @@ -522,6 +521,7 @@ object SharedUtil {
kPoint.slopeColor = point.slopeColor
kPoint.colourARGB = point.colourARGB
kPoint.distance = point.distance
kPoint.link = point.link?.let { Link(it) }
copyExtensions(point, kPoint)
return kPoint
}
Expand Down Expand Up @@ -556,9 +556,9 @@ object SharedUtil {
fun kMetadata(metadata: GPXUtilities.Metadata): Metadata {
val kMetadata = Metadata()
kMetadata.name = metadata.name
kMetadata.link = Link(metadata.link)
kMetadata.keywords = metadata.keywords
kMetadata.time = metadata.time
kMetadata.link = metadata.link?.let { Link(it) }
if (metadata.author != null) {
kMetadata.author = kAuthor(metadata.author)
}
Expand All @@ -576,8 +576,8 @@ object SharedUtil {
fun kAuthor(author: GPXUtilities.Author): Author {
val kAuthor = Author()
kAuthor.name = author.name
kAuthor.link = Link(author.link)
kAuthor.email = author.email
kAuthor.link = author.link?.let { Link(it) }
copyExtensions(author, kAuthor)
return kAuthor
}
Expand Down

0 comments on commit 04683f5

Please sign in to comment.