Skip to content

Commit cbaecb3

Browse files
committed
Require clientKey for old SDK initialization API.
1 parent f60ede1 commit cbaecb3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Parse/Parse.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ + (void)initialize {
5454
///--------------------------------------
5555

5656
+ (void)setApplicationId:(NSString *)applicationId clientKey:(NSString *)clientKey {
57+
PFParameterAssert(clientKey.length, @"`clientKey` should not be nil.");
5758
currentParseConfiguration_.applicationId = applicationId;
5859
currentParseConfiguration_.clientKey = clientKey;
5960
currentParseConfiguration_.server = [PFInternalUtils parseServerURLString]; // TODO: (nlutsenko) Clean this up after tests are updated.

Tests/Unit/ParseSetupUnitTests.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ - (void)testInitializeWithNilApplicationIdShouldThrowException {
5050
NSString *yolo = nil;
5151
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:yolo]);
5252
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:@"a"]);
53-
}
54-
55-
- (void)testInitializeWithoutClientKeyNoThrow {
56-
XCTAssertNoThrow([Parse setApplicationId:@"a" clientKey:nil]);
53+
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:@"a" clientKey:yolo]);
5754
}
5855

5956
@end

0 commit comments

Comments
 (0)