added guard for empty or unreadable template file

refs #1019