Ensure conditions in IF ELSE queries are treated as booleans

This commit is contained in:
Tobie Morgan Hitchcock 2019-02-05 18:48:43 +00:00
parent d3fea6365f
commit 80f532436e

View file

@ -171,7 +171,7 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o
if err != nil { if err != nil {
return nil, err return nil, err
} }
if chk, ok := ife.(bool); ok && chk { if calcAsBool(ife) {
return e.fetch(ctx, val.Then[k], doc) return e.fetch(ctx, val.Then[k], doc)
} }
} }
@ -184,7 +184,7 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o
if err != nil { if err != nil {
return nil, err return nil, err
} }
if chk, ok := ife.(bool); ok && chk { if calcAsBool(ife) {
return e.fetch(ctx, val.Then[k], doc) return e.fetch(ctx, val.Then[k], doc)
} }
} }