From 1be7be87a78027b44b7e00c3fdf520cfe3e3284a Mon Sep 17 00:00:00 2001 From: Hussein Habibi Juybari Date: Wed, 15 Mar 2023 21:14:16 +0330 Subject: [PATCH] Fixed bug when changing toolbar text color and hiding other menus --- cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt b/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt index 2652efd7..9bbe0bab 100644 --- a/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt +++ b/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt @@ -450,7 +450,7 @@ open class CropImageActivity : AppCompatActivity(), OnSetImageUriCompleteListene * Update the color of a specific menu item to the given color. */ open fun updateMenuItemTextColor(menu: Menu, itemId: Int, color: Int) { - val menuItem = menu.findItem(itemId) + val menuItem = menu.findItem(itemId) ?: return val menuTitle = menuItem.title if (menuTitle?.isNotBlank() == true) { try {