Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

当 @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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants