Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit af33844

Browse files
authored
Merge pull request #555 from wordpress-mobile/update-nsobject-expecations
Update NSObject-SafeExpecations
2 parents 146821b + a568311 commit af33844

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Nodes with values to reuse in the pipeline.
22
common_params:
33
plugins: &common_plugins
4-
- automattic/bash-cache#2.8.0
4+
- automattic/bash-cache#2.12.0
55
# Common environment values to use with the `env` key.
66
env: &common_env
77
IMAGE_ID: xcode-13.4.1

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ _None._
4646

4747
### Internal Changes
4848

49-
_None._
49+
- Change the NSObject+SafeExpectations dependency to `~> 0.0.4`. [#555]
5050

5151
## [5.0.0](https://github.com/wordpress-mobile/WordPressKit-iOS/releases/tag/5.0.0)
5252

Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PODS:
22
- Alamofire (4.8.2)
3-
- NSObject-SafeExpectations (0.0.4)
4-
- OCMock (3.8.1)
3+
- NSObject-SafeExpectations (0.0.6)
4+
- OCMock (3.9.1)
55
- OHHTTPStubs (9.1.0):
66
- OHHTTPStubs/Default (= 9.1.0)
77
- OHHTTPStubs/Core (9.1.0)
@@ -17,7 +17,7 @@ PODS:
1717
- OHHTTPStubs/OHPathHelpers (9.1.0)
1818
- OHHTTPStubs/Swift (9.1.0):
1919
- OHHTTPStubs/Default
20-
- UIDeviceIdentifier (2.0.0)
20+
- UIDeviceIdentifier (2.2.0)
2121
- WordPressShared (2.0.0-beta.2)
2222
- wpxmlrpc (0.9.0)
2323

@@ -43,10 +43,10 @@ SPEC REPOS:
4343

4444
SPEC CHECKSUMS:
4545
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
46-
NSObject-SafeExpectations: ab8fe623d36b25aa1f150affa324e40a2f3c0374
47-
OCMock: 29f6e52085b4e7d9b075cbf03ed7c3112f82f934
46+
NSObject-SafeExpectations: c01c8881cbd97efad6f668286b913cd0b7d62ab5
47+
OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8
4848
OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831
49-
UIDeviceIdentifier: af4e11e25a2ea670078e2bd677bb0e8144f9f063
49+
UIDeviceIdentifier: f33af270ba9045ea18b31d9aab88e42a0082ea67
5050
WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb
5151
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
5252

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
2323
s.header_dir = 'WordPressKit'
2424

2525
s.dependency 'Alamofire', '~> 4.8.0'
26-
s.dependency 'NSObject-SafeExpectations', '0.0.4'
26+
s.dependency 'NSObject-SafeExpectations', '~> 0.0.4'
2727
s.dependency 'wpxmlrpc', '~> 0.9'
2828
s.dependency 'UIDeviceIdentifier', '~> 2.0'
2929

WordPressKit/SharingServiceRemote.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
5757
}
5858

5959
let responseString = responseObject.description as NSString
60-
let services = responseDict.forKey(ServiceDictionaryKeys.services) as NSDictionary
60+
let services: NSDictionary = (responseDict.forKey(ServiceDictionaryKeys.services) as? NSDictionary) ?? NSDictionary()
6161

6262
let publicizeServices: [RemotePublicizeService] = services.allKeys.map { (key) -> RemotePublicizeService in
63-
let dict = services.forKey(key) as NSDictionary
63+
let dict = (services.forKey(key) as? NSDictionary) ?? NSDictionary()
6464
let pub = RemotePublicizeService()
6565

66-
pub.connectURL = dict.string(forKey: ServiceDictionaryKeys.connectURL)
67-
pub.detail = dict.string(forKey: ServiceDictionaryKeys.description)
68-
pub.externalUsersOnly = dict.number(forKey: ServiceDictionaryKeys.externalUsersOnly).boolValue
69-
pub.icon = dict.string(forKey: ServiceDictionaryKeys.icon)
70-
pub.serviceID = dict.string(forKey: ServiceDictionaryKeys.ID)
71-
pub.jetpackModuleRequired = dict.string(forKey: ServiceDictionaryKeys.jetpackModuleRequired)
72-
pub.jetpackSupport = dict.number(forKey: ServiceDictionaryKeys.jetpackSupport).boolValue
73-
pub.label = dict.string(forKey: ServiceDictionaryKeys.label)
74-
pub.multipleExternalUserIDSupport = dict.number(forKey: ServiceDictionaryKeys.multipleExternalUserIDSupport).boolValue
75-
pub.type = dict.string(forKey: ServiceDictionaryKeys.type)
66+
pub.connectURL = dict.string(forKey: ServiceDictionaryKeys.connectURL) ?? ""
67+
pub.detail = dict.string(forKey: ServiceDictionaryKeys.description) ?? ""
68+
pub.externalUsersOnly = dict.number(forKey: ServiceDictionaryKeys.externalUsersOnly)?.boolValue ?? false
69+
pub.icon = dict.string(forKey: ServiceDictionaryKeys.icon) ?? ""
70+
pub.serviceID = dict.string(forKey: ServiceDictionaryKeys.ID) ?? ""
71+
pub.jetpackModuleRequired = dict.string(forKey: ServiceDictionaryKeys.jetpackModuleRequired) ?? ""
72+
pub.jetpackSupport = dict.number(forKey: ServiceDictionaryKeys.jetpackSupport)?.boolValue ?? false
73+
pub.label = dict.string(forKey: ServiceDictionaryKeys.label) ?? ""
74+
pub.multipleExternalUserIDSupport = dict.number(forKey: ServiceDictionaryKeys.multipleExternalUserIDSupport)?.boolValue ?? false
75+
pub.type = dict.string(forKey: ServiceDictionaryKeys.type) ?? ""
7676

7777
// We're not guarenteed to get the right order by inspecting the
7878
// response dictionary's keys. Instead, we can check the index
@@ -112,7 +112,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
112112
return
113113
}
114114

115-
let connections: Array = responseDict.array(forKey: ConnectionDictionaryKeys.connections)
115+
let connections = responseDict.array(forKey: ConnectionDictionaryKeys.connections) ?? []
116116
let keyringConnections: [KeyringConnection] = connections.map { (dict) -> KeyringConnection in
117117
let conn = KeyringConnection()
118118
let dict = dict as AnyObject
@@ -186,7 +186,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
186186
return
187187
}
188188

189-
let connections: Array = responseDict.array(forKey: ConnectionDictionaryKeys.connections)
189+
let connections = responseDict.array(forKey: ConnectionDictionaryKeys.connections) ?? []
190190
let publicizeConnections: [RemotePublicizeConnection] = connections.compactMap { (dict) -> RemotePublicizeConnection? in
191191
let conn = self.remotePublicizeConnectionFromDictionary(dict as! NSDictionary)
192192
return conn
@@ -421,7 +421,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
421421
return
422422
}
423423

424-
let buttons = responseDict.array(forKey: SharingButtonsKeys.sharingButtons) as NSArray
424+
let buttons = responseDict.array(forKey: SharingButtonsKeys.sharingButtons) as? NSArray ?? NSArray()
425425
let sharingButtons = self.remoteSharingButtonsFromDictionary(buttons)
426426

427427
onSuccess(sharingButtons)
@@ -457,7 +457,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
457457
return
458458
}
459459

460-
let buttons = responseDict.array(forKey: SharingButtonsKeys.updated) as NSArray
460+
let buttons = responseDict.array(forKey: SharingButtonsKeys.updated) as? NSArray ?? NSArray()
461461
let sharingButtons = self.remoteSharingButtonsFromDictionary(buttons)
462462

463463
onSuccess(sharingButtons)

0 commit comments

Comments
 (0)