From 2d2ed870dacfe092eb6acbcaae5e51775c611322 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 18 Jul 2022 01:50:02 +0200 Subject: [PATCH] fix: check if node has attributes before accessing them --- .../sponsorblock/resource/patch/SponsorBlockResourcePatch.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt index f552b91ed..0696e9b6b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt @@ -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"