mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Fix NPE in spoiler renderer.
This commit is contained in:
@@ -64,10 +64,10 @@ fun TextView.setRelativeDrawables(
|
||||
* Get a lifecycle associated with this view. Care must be taken to ensure
|
||||
* if activity fallback occurs that the context of the view is correct.
|
||||
*/
|
||||
fun View.getLifecycle(): Lifecycle {
|
||||
fun View.getLifecycle(): Lifecycle? {
|
||||
return try {
|
||||
findFragment<Fragment>().viewLifecycleOwner.lifecycle
|
||||
} catch (e: IllegalStateException) {
|
||||
ViewUtil.getActivityLifecycle(this)!!
|
||||
ViewUtil.getActivityLifecycle(this)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user