1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

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.
This commit is contained in:
kaz saita 2025-12-16 15:33:01 +09:00
parent 7617f6b480
commit 661e3d03e6

View file

@ -1308,12 +1308,18 @@ public:
{
const auto params = FromVar::convert<EvaluateJavascriptCallbackParams> (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;