diff --git a/ParseTwitterUtils/Internal/OAuthCore/PF_OAuthCore.m b/ParseTwitterUtils/Internal/OAuthCore/PF_OAuthCore.m index b56ca95..acf903a 100644 --- a/ParseTwitterUtils/Internal/OAuthCore/PF_OAuthCore.m +++ b/ParseTwitterUtils/Internal/OAuthCore/PF_OAuthCore.m @@ -84,7 +84,9 @@ + (NSString *)authorizationHeaderFromConfiguration:(PFOAuthConfiguration *)confi // combine all parameters NSMutableDictionary *parameters = [oAuthAuthorizationParameters mutableCopy]; [parameters addEntriesFromDictionary:additionalQueryParameters]; - [parameters addEntriesFromDictionary:additionalBodyParameters]; + if (additionalBodyParameters) { + [parameters addEntriesFromDictionary:additionalBodyParameters]; + } NSArray *sortedKeys = [[parameters allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { return [obj1 compare:obj2] ?: [parameters[obj1] compare:parameters[obj2]]; diff --git a/Tests/Unit/TwitterTests.m b/Tests/Unit/TwitterTests.m index 6469cee..8e81b81 100644 --- a/Tests/Unit/TwitterTests.m +++ b/Tests/Unit/TwitterTests.m @@ -643,7 +643,6 @@ - (void)testDeauthorizeLoggedOutAccount { - (void)testDeauthorizeLoggedInAccount { id mockedStore = PFStrictClassMock([ACAccountStore class]); id mockedURLSession = PFStrictClassMock([NSURLSession class]); - id mockedOperationQueue = PFStrictClassMock([NSOperationQueue class]); id mockedDialog = PFStrictProtocolMock(@protocol(PFOAuth1FlowDialogInterface)); PF_Twitter *twitter = [[PF_Twitter alloc] initWithAccountStore:mockedStore urlSession:mockedURLSession dialogClass:mockedDialog];