mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
Merge pull request #763 from peco/fix-getlist-panic
guard GetList against empty KeyList
This commit is contained in:
commit
3c54a192a7
|
|
@ -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])
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue