mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-05-06 09:24:08 +00:00
[YouTube] Access first element if array size is one
Fixes a regression, where if the challenge data array size was one, the second element
would be accessed, leading to a crash.
This was introduced when porting the challenge parsing from JS to
Kotlin.
Ref: 53b599b042
This commit is contained in:
parent
196c27792b
commit
e1dedd45ed
@ -17,7 +17,7 @@ fun parseChallengeData(rawChallengeData: String): String {
|
|||||||
val descrambled = descramble(scrambled.getString(1))
|
val descrambled = descramble(scrambled.getString(1))
|
||||||
JsonParser.array().from(descrambled)
|
JsonParser.array().from(descrambled)
|
||||||
} else {
|
} else {
|
||||||
scrambled.getArray(1)
|
scrambled.getArray(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
val messageId = challengeData.getString(0)
|
val messageId = challengeData.getString(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user