File tree Expand file tree Collapse file tree
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,16 +32,32 @@ public class InputBuilder {
3232 }
3333
3434 public InputBuilder from (String expr ) {
35- if (this .input .getFrom () == null ) this .input .setFrom (new InputFrom ());
36- else this .input .getFrom ().setObject (null );
35+ if (expr == null ) {
36+ this .input .setFrom (null );
37+ return this ;
38+ }
39+
40+ if (this .input .getFrom () == null ) {
41+ this .input .setFrom (new InputFrom ());
42+ } else {
43+ this .input .getFrom ().setObject (null );
44+ }
3745
3846 this .input .getFrom ().setString (expr );
3947 return this ;
4048 }
4149
4250 public InputBuilder from (Object object ) {
43- if (this .input .getFrom () == null ) this .input .setFrom (new InputFrom ());
44- else this .input .getFrom ().setString (null );
51+ if (object == null ) {
52+ this .input .setFrom (null );
53+ return this ;
54+ }
55+
56+ if (this .input .getFrom () == null ) {
57+ this .input .setFrom (new InputFrom ());
58+ } else {
59+ this .input .getFrom ().setString (null );
60+ }
4561
4662 this .input .getFrom ().setObject (object );
4763 return this ;
You can’t perform that action at this time.
0 commit comments