Skip to content
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

当 @type 的前缀为一个autotype白名单时会发生 null point #3109

Closed
czjxy881 opened this issue Apr 1, 2020 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@czjxy881
Copy link

czjxy881 commented Apr 1, 2020

复现方式

image

public class TestFastJson {
    public static void main(String[] args) {
        ParserConfig.getGlobalInstance().addAccept("test");
        JSON.parseObject("{\"@type\":\"testxx\",\"dogName\":\"dog1001\"}", Dog.class);
    }
    public static class Dog  {
        public String dogName;
    }
}

原因

image
此处没有判断 clazz 是否为 null

wenshao added a commit that referenced this issue May 4, 2020
@wenshao wenshao added this to the 1.2.69 milestone May 4, 2020
@wenshao wenshao self-assigned this May 4, 2020
@wenshao wenshao added the bug label May 4, 2020
@wenshao wenshao closed this as completed May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants