kopia lustrzana https://github.com/ryukoposting/Signal-Android
Catch IAE instead of checking lifecycle.
rodzic
26e04ce6d2
commit
566e981473
|
@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.recipients.Recipient
|
|||
import org.thoughtcrime.securesms.util.ThemeUtil
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
import java.lang.IllegalArgumentException
|
||||
|
||||
private val TAG = Log.tag(BadgeImageView::class.java)
|
||||
|
||||
|
@ -42,11 +43,7 @@ class BadgeImageView @JvmOverloads constructor(
|
|||
fun setBadge(badge: Badge?) {
|
||||
visible = badge != null
|
||||
|
||||
val lifecycle = ViewUtil.getActivityLifecycle(this)
|
||||
if (lifecycle?.currentState == Lifecycle.State.DESTROYED) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
if (badge != null) {
|
||||
GlideApp
|
||||
.with(this)
|
||||
|
@ -59,5 +56,8 @@ class BadgeImageView @JvmOverloads constructor(
|
|||
.with(this)
|
||||
.clear(this)
|
||||
}
|
||||
} catch (e: IllegalArgumentException) {
|
||||
// Do nothing. Activity was destroyed.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue