From 661e3d03e6ef97f62bd42b89fdedea2c9488d4bd Mon Sep 17 00:00:00 2001 From: kaz saita Date: Tue, 16 Dec 2025 15:33:01 +0900 Subject: [PATCH] Fix: Allow nullptr callback in evaluateJavascript on Linux The callback parameter of WebBrowserComponent::evaluateJavascript has a default value of nullptr. Updated the Linux implementation to handle this case properly by checking if the callback queue is empty before attempting to invoke the callback. --- .../native/juce_WebBrowserComponent_linux.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_extra/native/juce_WebBrowserComponent_linux.cpp b/modules/juce_gui_extra/native/juce_WebBrowserComponent_linux.cpp index 0ea1c1e4dd..d9b495e042 100644 --- a/modules/juce_gui_extra/native/juce_WebBrowserComponent_linux.cpp +++ b/modules/juce_gui_extra/native/juce_WebBrowserComponent_linux.cpp @@ -1308,12 +1308,18 @@ public: { const auto params = FromVar::convert (paramsIn); - if (! params.has_value() || evaluationCallbacks.size() == 0) + if (! params.has_value()) { jassertfalse; return; } + // do nothing if there are no evaluation callbacks + if (evaluationCallbacks.empty()) + { + return; + } + const auto result = [&] { using Error = EvaluationResult::Error;