Skip to content

Commit 34a4fdf

Browse files
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 6b22a3e commit 34a4fdf

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/InputBuilder.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)