iter-iter.go: check ctx against nil on creation

This commit is contained in:
2026-05-08 10:14:07 +02:00
parent dfa1491093
commit a3c7cf2efa
2 changed files with 13 additions and 4 deletions
+3 -2
View File
@@ -92,9 +92,10 @@ func TestNewIterList5(t *testing.T) {
}
func TestNewIterList6(t *testing.T) {
ctx := NewSimpleStore()
list := kern.NewListA("a", "b", "c", "d")
it1, _ := NewIterator(nil, list, nil)
it, _ := NewIterator(nil, it1, nil)
it1, _ := NewIterator(ctx, list, nil)
it, _ := NewIterator(ctx, it1, nil)
if item, err := it.Next(); err != nil {
t.Errorf("error: %v", err)
} else if item != "a" {