Handle empty result of templating Also skip work when we omit (cherry picked from commit 6ebefaceb6)
6ebefaceb6