From d13b82d2a4acd56e1ba3069cf27499e22261be83 Mon Sep 17 00:00:00 2001 From: Emma Imber Date: Fri, 1 Dec 2023 12:00:12 +0000 Subject: [PATCH] Amend function again --- common/app/views/support/HtmlCleaner.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/app/views/support/HtmlCleaner.scala b/common/app/views/support/HtmlCleaner.scala index 9217f175f8a0..8f2f8d55d5ef 100644 --- a/common/app/views/support/HtmlCleaner.scala +++ b/common/app/views/support/HtmlCleaner.scala @@ -940,7 +940,7 @@ object AffiliateLinksCleaner { element.tagName == "a" && SkimLinksCache.isSkimLink(element.attr("href")) def insertAffiliateDisclaimer(document: Document, contentType: String): Document = { - val standfirstElement = document.getElementsByClass("tonal__standfirst")[0] + val standfirstElement = document.getElementsByClass("tonal__standfirst").first() standfirstElement.after(affiliateLinksDisclaimer(contentType).toString()) document }