fix watch progress crash

This commit is contained in:
Bnyro 2022-08-19 15:06:14 +02:00
parent 3ca43d9ad0
commit b259bfb8b0

View File

@ -25,7 +25,7 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { .addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() { override fun onGlobalLayout() {
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this) this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
if (progress == null) { if (progress == null || duration == 0L) {
view.visibility = View.GONE view.visibility = View.GONE
return return
} }