Skip to content

Commit

Permalink
Fix: Template is not applied when creating new file, by @tifish (PR #…
Browse files Browse the repository at this point in the history
  • Loading branch information
tifish authored Apr 29, 2022
1 parent 2102dc6 commit 7616818
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private AlertDialog.Builder makeDialog(final File basedir, final boolean allowCr
final byte[] templateContents = getTemplateContent(templateSpinner, basedir, f.getName(), encryptCheckbox.isChecked());
shareUtil.writeFile(f, false, (arg_ok, arg_fos) -> {
try {
if (f.exists() && f.length() < ShareUtil.MIN_OVERWRITE_LENGTH && templateContents != null) {
if (templateContents != null && (!f.exists() || f.length() < ShareUtil.MIN_OVERWRITE_LENGTH)) {
arg_fos.write(templateContents);
}
} catch (Exception ignored) {
Expand Down

0 comments on commit 7616818

Please sign in to comment.