Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Check for requestToken key and verifier before populating them #85

Merged
merged 1 commit into from
Oct 23, 2013
Merged

Check for requestToken key and verifier before populating them #85

merged 1 commit into from
Oct 23, 2013

Conversation

iwasrobbed
Copy link
Contributor

Hey Mattt,

I really appreciate all the work you've put into this and all things AFNetworking. My life is much easier because of it.

I just wanted to let you know that I found an error and here are the steps to reproduce it:

  1. Open the Twitter iOS Example Client app and run it
  2. When Safari is launched to the Twitter site to authenticate you, hit the "Cancel" button instead of hitting "Authorize"
  3. The app should show an error like below since one of the NSDictionary params was trying to be populated with a nil item

2013-09-18 11:36:51.304 Twitter iOS Example Client[2360:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: oauth_verifier)'
*** First throw call stack:
(0x2e9d0f53 0x390396af 0x2e90c727 0x8880f 0x87659 0x2f2ee817 0x2e993121 0x2e907317 0x672d1 0x313bc299 0x313487bf 0x31348697 0x311470cb 0x311469a9 0x311ac4fd 0x335d370d 0x335d32f7 0x2e99b9e7 0x2e99b983 0x2e99a157 0x2e904ce7 0x2e904acb 0x335d2283 0x311a6a41 0x66885 0x39541ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException

I implemented a quick check and return an NSError object now if the response was malformed. Please let me know if you are able to merge this or if you think there is a better way to accomplish this.

Cheers,
Rob

…he params in acquireOAuthAccessTokenWithPath:requestToken:accessMethod:success:failure
@dstnbrkr dstnbrkr mentioned this pull request Oct 14, 2013
@dstnbrkr
Copy link

+1

mattt added a commit that referenced this pull request Oct 23, 2013
Check for requestToken key and verifier before populating them
@mattt mattt merged commit ad827ee into AFNetworking:master Oct 23, 2013
@mattt
Copy link
Contributor

mattt commented Oct 23, 2013

Thanks, @iwasrobbed—this is greatly appreciated! I'll be cutting a new release soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants