- // file doesn't yet exist or backups are not enabled
- if ((!file.exists()) || (!enabled) || (max < 0))
+ // file doesn't yet exist or backups are not enabled or template is null or
+ // empty
+ if ((!file.exists()) || (!enabled) || max < 0 || suffix == null
+ || suffix.length() == 0)