File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
http-generator-jex/src/main/java/io/avaje/http/generator/jex Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ private void write(boolean requestScoped) {
103
103
}
104
104
writer .append (" " );
105
105
if (!method .isVoid ()) {
106
- writeContextReturn ();
106
+ writer .append ("var result = " );
107
+
107
108
}
108
109
if (instrumentContext ) {
109
110
method .writeContext (writer , "ctx" , "ctx" );
@@ -128,13 +129,17 @@ private void write(boolean requestScoped) {
128
129
}
129
130
}
130
131
writer .append (")" );
131
- if (!method .isVoid ()) {
132
- writer .append (")" );
133
- }
134
132
if (instrumentContext ) {
135
133
writer .append (")" );
136
134
}
137
135
writer .append (";" ).eol ();
136
+ if (!method .isVoid ()) {
137
+ writer .append (" if (result != null) {" ).eol ();
138
+ writer .append (" " );
139
+ writeContextReturn ();
140
+ writer .append ("result);" ).eol ();
141
+ writer .append (" }" ).eol ();
142
+ }
138
143
}
139
144
140
145
private void writeContextReturn () {
You can’t perform that action at this time.
0 commit comments