Fix null pointer dereference while post processing template

Static analysis report:
http://buildbot.lwan.ws/sa/2014-12-14-180413-884-1/report-36a1ef.html