Skip to content

Ptr Nil panic #15

@iTryIt

Description

@iTryIt

Nil Ptr cause panic
指针未做nil判断会导致panic

file: filter/parser.go
line: 19 to 22

Test:

type T struct {
    A string `json:"a,select(test)"`
}

func TestNil(t *testing.T) {
    var a *T
    var el = map[string]any{
        "a": a, // a: nil ptr
    }

    fmt.Println(filter.Select("test", el))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions