Clarify the logic for setting the URL

This commit is contained in:
Jed Fox 2023-02-07 13:37:36 -05:00
parent c93bfa7329
commit 2374a6552b
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
1 changed files with 3 additions and 1 deletions

View File

@ -97,7 +97,9 @@ extension SendPostIntentHandler: SendPostIntentHandling {
subtitle: content,
image: response.value.account.avatarImageURL().flatMap { INImage(url: $0) }
)
post.url = URL(string: response.value.url ?? "")
if let urlString = response.value.url {
post.url = URL(string: urlString)
}
posts.append(post)
} // end for in