fixes #2596
Merge pull request #2622 from dotCMS/issue-2596-edit-new-or-existing-template-goes-in-error

fixes #2596