Skip to content

Commit a25b493

Browse files
committed
Only render HeaderTemplate if result is non-null
1 parent 7cab284 commit a25b493

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Griddly/Views/Shared/Griddly/Griddly.cshtml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@
173173
}
174174
@if (settings.HeaderTemplate != null)
175175
{
176-
<tr class="griddly-header">
177-
<td colspan="@settings.Columns.Count">
178-
@settings.HeaderTemplate(Model)
179-
</td>
180-
</tr>
176+
var template = settings.HeaderTemplate(Model);
177+
178+
if (template != null)
179+
{
180+
<tr class="griddly-header">
181+
<td colspan="@settings.Columns.Count">
182+
@template
183+
</td>
184+
</tr>
185+
}
181186
}
182187
</thead>
183188
}

0 commit comments

Comments
 (0)