Merge pull request #763 from peco/fix-getlist-panic

guard GetList against empty KeyList
This commit is contained in:
lestrrat 2026-02-20 22:31:04 +09:00 committed by GitHub
commit 3c54a192a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,6 +59,9 @@ func NewTernaryNode(l Key) *TernaryNode {
// GetList looks up a child node matching the first key in the list.
func (n *TernaryNode) GetList(k KeyList) Node {
if len(k) == 0 {
return nil
}
return n.Get(k[0])
}