fix: check if node has attributes before accessing them
This commit is contained in:
parent
db410e1be6
commit
1d12a17999
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…
Add table
Add a link
Reference in a new issue