Skip to content

Commit 594ed5e

Browse files
author
Frank Martinez
authored
Merge pull request #4 from pointlander/bug-input
Skip coerce when IOMetadata is nil
2 parents cfeec3e + c6bcaae commit 594ed5e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

trigger/handler.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
78
"github.com/project-flogo/core/data/coerce"
89

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

150-
ioMd := act.act.IOMetadata()
151-
152-
for name, tv := range ioMd.Input {
153-
if val, ok := inputMap[name]; ok {
154-
inputMap[name], err = coerce.ToType(val, tv.Type())
155-
if err != nil {
156-
return nil, err
151+
if ioMd := act.act.IOMetadata(); ioMd != nil {
152+
for name, tv := range ioMd.Input {
153+
if val, ok := inputMap[name]; ok {
154+
inputMap[name], err = coerce.ToType(val, tv.Type())
155+
if err != nil {
156+
return nil, err
157+
}
157158
}
158159
}
159160
}

0 commit comments

Comments
 (0)