Skip to content

Commit 6bcf718

Browse files
authored
Fixed bug when changing toolbar text color (#556)
1 parent 498dfae commit 6bcf718

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ open class CropImageActivity : AppCompatActivity(), OnSetImageUriCompleteListene
450450
* Update the color of a specific menu item to the given color.
451451
*/
452452
open fun updateMenuItemTextColor(menu: Menu, itemId: Int, color: Int) {
453-
val menuItem = menu.findItem(itemId)
453+
val menuItem = menu.findItem(itemId) ?: return
454454
val menuTitle = menuItem.title
455455
if (menuTitle?.isNotBlank() == true) {
456456
try {

0 commit comments

Comments
 (0)