From c00e7717053f806e3b5b3f0bf0ca9c2da07c289b Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 14 Dec 2022 00:32:25 +0100 Subject: [PATCH] fix(predictive-back-gesture): create attribute, if it does not exist --- .../gestures/patch/PredictiveBackGesturePatch.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/all/interaction/gestures/patch/PredictiveBackGesturePatch.kt b/src/main/kotlin/app/revanced/patches/all/interaction/gestures/patch/PredictiveBackGesturePatch.kt index de1571ae1..31ab6f2fe 100644 --- a/src/main/kotlin/app/revanced/patches/all/interaction/gestures/patch/PredictiveBackGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/all/interaction/gestures/patch/PredictiveBackGesturePatch.kt @@ -19,11 +19,12 @@ class PredictiveBackGesturePatch : ResourcePatch { val document = editor.file with(document.getElementsByTagName("application").item(0)) { - attributes.getNamedItem(FLAG)?.let { - document.createAttribute(FLAG) - .apply { value = "true" } - .let(attributes::setNamedItem) - } + if (attributes.getNamedItem(FLAG) != null) return@with + + document.createAttribute(FLAG) + .apply { value = "true" } + .let(attributes::setNamedItem) + } }