added guard for empty or unreadable template files

refs #1019