fixes #4817
Merge pull request #4865 from dotCMS/issue-4817-NPE-when-pushing-working-template

fixes #4817