Revert "Template: remove an unnecessary condition"

This reverts commit 99750374d22bf577fac55eb2e44904ac92708efa.