@@ -67,9 +67,6 @@ class Variable extends HelperResolver {
6767 /** Block params. */
6868 private static final List <String > BPARAMS = Collections .emptyList ();
6969
70- /** True, when no param/hash. */
71- private boolean noArg ;
72-
7370 /** Empty var. */
7471 private Template emptyVar ;
7572
@@ -98,7 +95,6 @@ class Variable extends HelperResolver {
9895 this .escapingStrategy =
9996 type == TagType .VAR ? handlebars .getEscapingStrategy () : EscapingStrategy .NOOP ;
10097 this .formatter = handlebars .getFormatter ();
101- this .noArg = params .size () == 0 && hash .size () == 0 ;
10298 postInit ();
10399 }
104100
@@ -135,8 +131,9 @@ protected void merge(final Context scope, final Writer writer) throws IOExceptio
135131 */
136132 @ SuppressWarnings ("unchecked" )
137133 public Object value (final Context scope , final Writer writer ) throws IOException {
138- boolean blockParam = scope .isBlockParams () && noArg ;
139- if (helper != null && !blockParam ) {
134+ boolean blockParam = scope .isBlockParams ();
135+ Object value = scope .get (path );
136+ if (helper != null && (!blockParam || (path .size () == 1 && value == null ))) {
140137 Options options =
141138 new Options (
142139 handlebars ,
@@ -152,7 +149,6 @@ public Object value(final Context scope, final Writer writer) throws IOException
152149 options .data (Context .PARAM_SIZE , this .params .size ());
153150 return helper .apply (determineContext (scope ), options );
154151 } else {
155- Object value = scope .get (path );
156152 if (value == null ) {
157153 if (missing != null ) {
158154 Options options =
0 commit comments