Skip to content

Commit

Permalink
Merge pull request #4 from pointlander/bug-input
Browse files Browse the repository at this point in the history
Skip coerce when IOMetadata is nil
  • Loading branch information
Frank Martinez committed Nov 3, 2018
2 parents cfeec3e + c6bcaae commit 594ed5e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions trigger/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"

"github.com/project-flogo/core/data/coerce"

"github.com/project-flogo/core/action"
Expand Down Expand Up @@ -147,13 +148,13 @@ func (h *handlerImpl) Handle(ctx context.Context, triggerData interface{}) (map[
inputMap = triggerValues
}

ioMd := act.act.IOMetadata()

for name, tv := range ioMd.Input {
if val, ok := inputMap[name]; ok {
inputMap[name], err = coerce.ToType(val, tv.Type())
if err != nil {
return nil, err
if ioMd := act.act.IOMetadata(); ioMd != nil {
for name, tv := range ioMd.Input {
if val, ok := inputMap[name]; ok {
inputMap[name], err = coerce.ToType(val, tv.Type())
if err != nil {
return nil, err
}
}
}
}
Expand Down

0 comments on commit 594ed5e

Please sign in to comment.