fixes #2614 Issue publishing when a template doesn't have a Live version

Please check the fix and merge.