Skip to content

Do not parse if data is already object#16

Open
kanasite wants to merge 2 commits intoPCreations:masterfrom
kanasite:master
Open

Do not parse if data is already object#16
kanasite wants to merge 2 commits intoPCreations:masterfrom
kanasite:master

Conversation

@kanasite
Copy link

@kanasite kanasite commented Mar 25, 2020

@PCreations I encountered this error Uncaught SyntaxError: Unexpected token o in JSON at position 1 for certain situation, it turns out that data is already an object hence parsing twice causes the error

@ghost
Copy link

ghost commented Mar 25, 2020

Congratulations 🍻. DeepCode analyzed your code in 0.204 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues.


☺️ If you want to provide feedback on our bot, here is how to contact us.

Copy link
Owner

@PCreations PCreations left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ! We might want to add a unit test with a "data" being an object to test this though.

@kanasite
Copy link
Author

@PCreations I'm not very familiar with jest, looking at the existing test case, would you recommend or help with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants