Fix bug triggered by having no authors associated with a starred article.
This commit is contained in:
parent
85d4cc352f
commit
8ff0f23a55
@ -233,7 +233,7 @@ private extension CloudKitArticlesZone {
|
|||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
var parsedAuthors = [String]()
|
var parsedAuthors = [String]()
|
||||||
|
|
||||||
if let authors = article.authors {
|
if let authors = article.authors, !authors.isEmpty {
|
||||||
for author in authors {
|
for author in authors {
|
||||||
let parsedAuthor = ParsedAuthor(name: author.name,
|
let parsedAuthor = ParsedAuthor(name: author.name,
|
||||||
url: author.url,
|
url: author.url,
|
||||||
@ -243,10 +243,9 @@ private extension CloudKitArticlesZone {
|
|||||||
parsedAuthors.append(encodedParsedAuthor)
|
parsedAuthors.append(encodedParsedAuthor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
articleRecord[CloudKitArticle.Fields.parsedAuthors] = parsedAuthors
|
||||||
}
|
}
|
||||||
|
|
||||||
articleRecord[CloudKitArticle.Fields.parsedAuthors] = parsedAuthors
|
|
||||||
|
|
||||||
records.append(articleRecord)
|
records.append(articleRecord)
|
||||||
return records
|
return records
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user