fastjson icon indicating copy to clipboard operation
fastjson copied to clipboard

Fix Issue#3962

Open a1batr0ss opened this issue 2 years ago • 2 comments

Fix Issue3962: 对于JSON.parse(),参数为空字符串时,返回值为null, 若不判空,后边代码会抛出空指针异常。

a1batr0ss avatar Sep 11 '23 15:09 a1batr0ss

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


惠飞 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 11 '23 15:09 CLAassistant

Fix Issue3962: 对于JSON.parse(),参数为空字符串时,返回值为null, 若不判空,后边代码会抛出空指针异常。

感謝您的發現 引入方法(JSONObject from(String text)) 呼叫 Json.parseObject(String) 和內部 pasrseObject 方法正在處理 null 或空字串。

請參閱下面的螢幕截圖以供參考

image

arjun12102019 avatar Apr 19 '24 09:04 arjun12102019