-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
program crash everytime, when other data type incomming in json stream as expected #1612
Comments
Can you provide more information? Maybe example code? The library throws an exception in case of a parse error - is this your issue? |
Yes ihre this auto user_input = j_string.getstd::string(); |
You need to check the types yourself. Code like std:.string user_input;
if ( j_string.is_string())
user_input = j; is safe. |
I mean like that: std:string user_input = jsondata("inputdtream").getstd:string(). |
thanks |
i use this nhlohman in backend , this wonderfull tool, i becomme every second json stream from outside, but when the users send other datatyp in json stream, my backend crash every time, i muss use in every code line try catch, to prevent crash backend, there is no other solution please, thanks
Describe what you want to achieve.
Describe what you tried.
Describe which system (OS, compiler) you are using.
Describe which version of the library you are using (release version, develop branch).
The text was updated successfully, but these errors were encountered: