commit 2207b1a61d6470be891c62c61b79dbea4379019b
parent edba5922413b3eb2af0fd454333c145727a8ae0f
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Sat, 27 May 2023 10:15:50 +0200

fix(unlimitedsnapviewtime): has audio npe

Diffstat:
Mapp/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt b/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/UnlimitedSnapViewTime.kt @@ -22,10 +22,11 @@ class UnlimitedSnapViewTime : if (message.messageContent.contentType != ContentType.SNAP) return@hookConstructor with(message.messageContent) { - val hasSound = ProtoReader(this.content).getInt(11, 5, 2, 5)!! this.content = ProtoEditor(this.content).apply { edit(11, 5, 2) { - writeConstant(5, hasSound) + ProtoReader(this@with.content).getInt(11, 5, 2, 5)?.let { + writeConstant(5, it) + } writeBuffer(6, byteArrayOf()) } }.toByteArray()