mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 09:07:46 +01:00
fix: check if node has attributes before accessing them
This commit is contained in:
parent
36af4cc14f
commit
2d2ed870da
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
|
|||
val view = children.item(i)
|
||||
|
||||
// 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
|
||||
val votingButtonId = "@+id/voting_button"
|
||||
|
|
Loading…
Reference in a new issue