Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressKit"
s.version = "4.7.1-beta.1"
s.version = "4.8.0-beta.1"
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."

s.description = <<-DESC
Expand Down
23 changes: 16 additions & 7 deletions WordPressKit/GravatarServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@ open class GravatarServiceRemote {
}
do {
let jsonData = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
if let jsonDictionary = jsonData as? [String: Array<Any>],

guard let jsonDictionary = jsonData as? [String: Array<Any>],
let entry = jsonDictionary["entry"],
let profileData = entry.first as? NSDictionary {
let profile = RemoteGravatarProfile(dictionary: profileData)
DispatchQueue.main.async {
success(profile)
}
return
let profileData = entry.first as? NSDictionary else {
DispatchQueue.main.async {
// This case typically happens when the endpoint does
// successfully return but doesn't find the user.
failure(nil)
}
return
}

let profile = RemoteGravatarProfile(dictionary: profileData)
DispatchQueue.main.async {
success(profile)
}
return

} catch {
failure (error)
return
Expand Down