Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

fixed crash on saving (iOS4) #4

Closed
wants to merge 1 commit into from

Conversation

ishkawa
Copy link

@ishkawa ishkawa commented Feb 26, 2013

When NSJSONSerialization is not available (iOS4), HTTP body will be assembled by pkt_URLEncodedFormString:. The argument (NSDictionary) may be contain NSNumber, but this method does not transfer the type of it. This leads to crash in [PocketAPIOperation encodeForURL:value].

I avoided this issue by transferring the type.

example of argument

key(NSString): time
value(NSNumber): 1361867614

key(NSString): consumer_key
value(NSString): *****

key(NSString): url
value(NSString): http://www.example.com

key(NSString): access_token
value(NSString): *****

@stevestreza
Copy link
Contributor

I'd like to make this fix a little more resilient. Could you try this branch to see if it fixes your issue?

https://github.com/Pocket/Pocket-ObjC-SDK/tree/fix/4

stevestreza pushed a commit that referenced this pull request Feb 26, 2013
Fixes URL encoding for non-NSString objects by ensuring they are converted to NSString objects before being URL-encoded, preventing a crash #4
maicki added a commit that referenced this pull request Jan 14, 2015
Fixes URL encoding for non-NSString objects by ensuring they are converted to NSString objects before being URL-encoded, preventing a crash #4
@maicki
Copy link
Contributor

maicki commented Jan 14, 2015

Fixed in 1.0.3

@maicki maicki closed this Jan 14, 2015
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