Added conditions for some robustness

This commit is contained in:
Ziver Koc 2015-12-11 23:53:24 +01:00
parent 930ad2b2f3
commit 31c700b738
3 changed files with 4 additions and 2 deletions

View file

@ -101,6 +101,8 @@ public class Templator {
* be regenerated if the file changes.
*/
public Templator(File tmpl) throws IOException {
if(tmpl == null)
throw new IllegalArgumentException("File can not be null!");
this.data = new HashMap<String, Object>();
this.file = tmpl;
parseTemplate(FileUtil.getContent(file));