File tree 1 file changed +21
-18
lines changed
1 file changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -57,25 +57,28 @@ func (a *Activity) Eval(ctx activity.Context) (done bool, err error) {
57
57
if err != nil {
58
58
output .Error = true
59
59
output .ErrorMessage = err .Error ()
60
- return true , nil
61
- }
62
- //todo is ok to ignore the errors for the SetInVM calls?
63
- _ = vm .SetInVM ("parameters" , input .Parameters )
64
- _ = vm .SetInVM ("result" , result )
65
-
66
- _ , err = vm .vm .RunScript ("JSServiceScript" , a .script )
67
- if err != nil {
68
- output .Error = true
69
- output .ErrorMessage = err .Error ()
70
- return true , nil
71
60
}
72
- err = vm .GetFromVM ("result" , & result )
73
- if err != nil {
74
- output .Error = true
75
- output .ErrorMessage = err .Error ()
76
- return true , nil
77
- }
78
- output .Result = result
61
+ if vm != nil {
62
+ //todo is ok to ignore the errors for the SetInVM calls?
63
+ _ = vm .SetInVM ("parameters" , input .Parameters )
64
+ _ = vm .SetInVM ("result" , result )
65
+
66
+ _ , err = vm .vm .RunScript ("JSServiceScript" , a .script )
67
+ if err != nil {
68
+ output .Error = true
69
+ output .ErrorMessage = err .Error ()
70
+ } else {
71
+ err = vm .GetFromVM ("result" , & result )
72
+ if err != nil {
73
+ output .Error = true
74
+ output .ErrorMessage = err .Error ()
75
+ } else {
76
+ output .Error = false
77
+ output .ErrorMessage = ""
78
+ output .Result = result
79
+ }
80
+ }
81
+ }
79
82
80
83
err = ctx .SetOutputObject (& output )
81
84
if err != nil {
You can’t perform that action at this time.
0 commit comments