template: protect to not abort on nil values