Skip to content

Commit

Permalink
a[b] for invalid a or b
Browse files Browse the repository at this point in the history
  • Loading branch information
osteele committed Jul 9, 2017
1 parent 2f0f6ba commit 50d11a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions expression/builders.go
Expand Up @@ -43,6 +43,9 @@ func makeIndexExpr(obj, index func(Context) interface{}) func(Context) interface
return func(ctx Context) interface{} {
ref := reflect.ValueOf(obj(ctx))
i := reflect.ValueOf(index(ctx))
if !ref.IsValid() || !i.IsValid() {
return nil
}
switch ref.Kind() {
case reflect.Array, reflect.Slice:
switch i.Kind() {
Expand Down

0 comments on commit 50d11a6

Please sign in to comment.