Make ParsedAttachment require a URL.

This commit is contained in:
Brent Simmons
2017-09-10 11:21:49 -07:00
parent 9ad83e58b3
commit 2943fca8e3
2 changed files with 7 additions and 17 deletions

View File

@@ -172,7 +172,9 @@ private extension RSSInJSONParser {
}
let type = enclosureObject["type"] as? String
let oneAttachment = ParsedAttachment(url: attachmentURL, mimeType: type, title: nil, sizeInBytes: attachmentSize, durationInSeconds: nil)
return Set([oneAttachment])
if let attachment = ParsedAttachment(url: attachmentURL, mimeType: type, title: nil, sizeInBytes: attachmentSize, durationInSeconds: nil) {
return Set([attachment])
}
return nil
}
}