From 17315b5be3e84698a28902a75910d733a0038fb6 Mon Sep 17 00:00:00 2001 From: milan-galitein Date: Wed, 13 Sep 2023 12:31:10 +0530 Subject: [PATCH] - Crash fixed NSInvalidArgumentException - Attempt to add script message handler with name 'mouseover' when one already exists. --- AAInfographics/AAChartCreator/AAChartView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/AAInfographics/AAChartCreator/AAChartView.swift b/AAInfographics/AAChartCreator/AAChartView.swift index 119c099e..87606de0 100644 --- a/AAInfographics/AAChartCreator/AAChartView.swift +++ b/AAInfographics/AAChartCreator/AAChartView.swift @@ -283,6 +283,7 @@ public class AAChartView: WKWebView { } private func addMouseOverEventMessageHandler() { + configuration.userContentController.removeScriptMessageHandler(forName: kUserContentMessageNameMouseOver) configuration.userContentController.add(AALeakAvoider.init(delegate: self), name: kUserContentMessageNameMouseOver) }