Make sure that article.preferredLink doesn’t return an empty string.
This commit is contained in:
parent
60f13c32a4
commit
5b15285e8e
|
@ -46,7 +46,13 @@ extension Article {
|
||||||
}
|
}
|
||||||
|
|
||||||
var preferredLink: String? {
|
var preferredLink: String? {
|
||||||
return url ?? externalURL
|
if let url = url, !url.isEmpty {
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
if let externalURL = externalURL, !externalURL.isEmpty {
|
||||||
|
return externalURL
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: String? {
|
var body: String? {
|
||||||
|
|
Loading…
Reference in New Issue