mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-01 03:55:37 +02:00
fix: check if node has attributes before accessing them
This commit is contained in:
parent
36af4cc14f
commit
2d2ed870da
@ -88,7 +88,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
|
|||||||
val view = children.item(i)
|
val view = children.item(i)
|
||||||
|
|
||||||
// Replace the attribute for a specific node only
|
// Replace the attribute for a specific node only
|
||||||
if (!view.attributes.getNamedItem("android:id").nodeValue.endsWith("live_chat_overlay_button")) continue
|
if (!(view.hasAttributes() && view.attributes.getNamedItem("android:id").nodeValue.endsWith("live_chat_overlay_button"))) continue
|
||||||
|
|
||||||
// voting button id from the voting button view from the youtube_controls_layout.xml host file
|
// voting button id from the voting button view from the youtube_controls_layout.xml host file
|
||||||
val votingButtonId = "@+id/voting_button"
|
val votingButtonId = "@+id/voting_button"
|
||||||
|
Loading…
Reference in New Issue
Block a user