Prevent renaming to empty folder name

pull/195/head
M66B 4 years ago
parent ec4b94d5a6
commit 3d081bf8f4

@ -603,6 +603,8 @@ public class FragmentFolder extends FragmentBase {
db.folder().insertFolder(create); db.folder().insertFolder(create);
} else { } else {
if (!folder.name.equals(name)) { if (!folder.name.equals(name)) {
if (TextUtils.isEmpty(name))
throw new IllegalArgumentException(context.getString(R.string.title_folder_name_missing));
EntityFolder target = db.folder().getFolderByName(folder.account, name); EntityFolder target = db.folder().getFolderByName(folder.account, name);
if (target != null) if (target != null)
throw new IllegalArgumentException(context.getString(R.string.title_folder_exists, name)); throw new IllegalArgumentException(context.getString(R.string.title_folder_exists, name));

Loading…
Cancel
Save