diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp index 3e6056f3a810..212e1866fa83 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp @@ -746,8 +746,9 @@ void TestPlugin::CallFlutterThrowError( std::function> reply)> result) { flutter_api_->ThrowError( - [result](const std::optional& echo) { - result(echo); + [result](const flutter::EncodableValue* echo) { + result(echo ? std::optional(*echo) + : std::nullopt); }, [result](const FlutterError& error) { result(error); }); }