-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON value '<null>' of type NSNULL canot be converted to NSNumber (iOS) #51
Comments
I think this bug is in following lines: the minimum code to reproduce: "c.202.187.306.432.312.68"
.replace(/(\.[\d]+)(\-?\.)/ig, '$1,$2') // "c.202,.187.306,.432.312,.68"
.match(/[a-df-z]|[\-+]?(?:[\d\.]e[\-+]?|[^\s\-+,a-z])+/ig); // ["c", ".202", ".187.306", ".432.312", ".68"] after parsing, the array contains two points like '.187.306' which cannot covert to a number. Hope that's helpful. |
i've created a very simple script to solve this: https://gist.github.com/chunghe/8472c99f12beaf93fef41f30e7338d62 Replace the parser above written in Regex with svg-path-parser which is more robust and works perfectly. |
@magicismight i'm not sure using 3rd-party svg path parser is the way you want to go, if yes, i could try to come up with the pull request. |
@chunghe
|
Example
Mostly I am having issues at SerializablePath.curve method which appears to not parse the values correctly in most cases. x + (+c1x) and y + (+c1y) evaluate to NaN often. You check for isNil, but what are you doing for cases in which it is not a number? And are you relying on implicit conversion for floats, ints etc?
The text was updated successfully, but these errors were encountered: