Fix bug finding channel element in RSS-in-JSON parser.

This commit is contained in:
Brent Simmons
2017-06-26 19:51:01 -07:00
parent 49a5e58ff2
commit c32e1a3933
5 changed files with 434 additions and 906 deletions

View File

@@ -19,8 +19,10 @@ public struct RSSInJSONParser {
guard let parsedObject = try JSONSerialization.jsonObject(with: parserData.data) as? JSONDictionary else {
throw FeedParserError(.invalidJSON)
}
guard let channelObject = parsedObject["channel"] as? JSONDictionary else {
guard let rssObject = parsedObject["rss"] as? JSONDictionary else {
throw FeedParserError(.rssChannelNotFound)
}
guard let channelObject = rssObject["channel"] as? JSONDictionary else {
throw FeedParserError(.rssChannelNotFound)
}