Closed AsterDY closed 4 months ago
func TestNodeSortKeys2(t *testing.T) { root, err := NewSearcher(_TwitterJson).GetByPath() if err != nil { t.Fatal(err) } t.Run("single", func(t *testing.T) { r := root.Get("statuses") if r.Check() != nil { t.Fatal(r.Error()) } require.NoError(t, root.SortKeys(false)) }) t.Run("recurse", func(t *testing.T) { require.NoError(t, root.SortKeys(true)) }) }
-- runtime error: invalid memory address or nil pointer dereference
sortKey() use unsafeMap() at the beginning , which doesn't considerV_RAW type nodes
sortKey()
unsafeMap()
V_RAW
Reproduce Code
Reason
sortKey()
useunsafeMap()
at the beginning , which doesn't considerV_RAW
type nodes