Skip to content

Commit

Permalink
Merge pull request #180 from TIBCOSoftware/issue-281
Browse files Browse the repository at this point in the history
  • Loading branch information
lixingwang authored May 25, 2018
2 parents 73db9b2 + 9a3a1b6 commit 116a47d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/mapper/exprmapper/json/gabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package json
import (
"encoding/json"
"errors"
"github.com/TIBCOSoftware/flogo-lib/core/data"
"io"
"io/ioutil"
"strings"
Expand Down Expand Up @@ -355,7 +356,12 @@ func (g *Container) ArrayElement(index int, path ...string) (*Container, error)
}
array, ok := g.Search(path...).Data().([]interface{})
if !ok {
return &Container{nil}, ErrNotArray
//Convert to array
var err error
array, err = data.CoerceToArray(g.Search(path...).Data())
if err != nil {
return &Container{nil}, ErrNotArray
}
}
if index < len(array) {
return &Container{array[index]}, nil
Expand Down

0 comments on commit 116a47d

Please sign in to comment.