diff --git a/Parse/Parse.m b/Parse/Parse.m index a46983e71..d311de24b 100644 --- a/Parse/Parse.m +++ b/Parse/Parse.m @@ -54,6 +54,7 @@ + (void)initialize { ///-------------------------------------- + (void)setApplicationId:(NSString *)applicationId clientKey:(NSString *)clientKey { + PFParameterAssert(clientKey.length, @"`clientKey` should not be nil."); currentParseConfiguration_.applicationId = applicationId; currentParseConfiguration_.clientKey = clientKey; currentParseConfiguration_.server = [PFInternalUtils parseServerURLString]; // TODO: (nlutsenko) Clean this up after tests are updated. diff --git a/Tests/Unit/ParseSetupUnitTests.m b/Tests/Unit/ParseSetupUnitTests.m index f89f533fa..984b4eae0 100644 --- a/Tests/Unit/ParseSetupUnitTests.m +++ b/Tests/Unit/ParseSetupUnitTests.m @@ -50,10 +50,7 @@ - (void)testInitializeWithNilApplicationIdShouldThrowException { NSString *yolo = nil; PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:yolo]); PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:@"a"]); -} - -- (void)testInitializeWithoutClientKeyNoThrow { - XCTAssertNoThrow([Parse setApplicationId:@"a" clientKey:nil]); + PFAssertThrowsInvalidArgumentException([Parse setApplicationId:@"a" clientKey:yolo]); } @end