Fix being able to make a blank category

This commit is contained in:
Jays2Kings 2021-04-10 23:33:12 -04:00
parent e53bae4413
commit 48dae05980

View File

@ -113,6 +113,10 @@ class CategoryController(bundle: Bundle? = null) :
override fun onCategoryRename(position: Int, newName: String): Boolean {
val category = adapter?.getItem(position)?.category ?: return false
if (newName.isBlank()) {
activity?.toast(R.string.category_cannot_be_blank)
return false
}
if (category.order == CREATE_CATEGORY_ORDER) {
return (presenter.createCategory(newName))
}