Skip to content

Commit

Permalink
fix yaml.List Item method
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
  • Loading branch information
vtolstov committed Jul 19, 2012
1 parent 43b640f commit 3e5a49b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yaml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (node List) Len() int {

// Get the idx'th item from the List.
func (node List) Item(idx int) Node {
if idx < 0 || idx > len(node) {
if idx >= 0 && idx < len(node) {
return node[idx]
}
return nil
Expand Down

0 comments on commit 3e5a49b

Please sign in to comment.