Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goo ring x fix windows call handler crash #2454

Open
wants to merge 3 commits into
base: v6.2.0-beta.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,18 @@ class _CustomPlatformViewState extends State<CustomPlatformView>

_controller.initialize(
onPlatformViewCreated: (id) {
if (!mounted) {
return;
}
widget.onPlatformViewCreated?.call(id);
setState(() {});
},
arguments: widget.creationParams);

_listener = AppLifecycleListener(onStateChange: (state) {
if (!mounted) {
return;
}
if ([AppLifecycleState.resumed, AppLifecycleState.hidden]
.contains(state)) {
_reportSurfaceSize();
Expand Down Expand Up @@ -467,6 +473,9 @@ class _CustomPlatformViewState extends State<CustomPlatformView>
final box = _key.currentContext?.findRenderObject() as RenderBox?;
if (box != null) {
await _controller.ready;
if (!mounted) {
return;
}
final position = box.localToGlobal(Offset.zero);
unawaited(_controller._setPosition(
position, widget.scaleFactor ?? window.devicePixelRatio));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ namespace flutter_inappwebview_plugin
callback->defaultBehaviour = [this, callHandlerID](const std::optional<const flutter::EncodableValue*> response)
{
std::string json = "null";
if (response.has_value() && !response.value()->IsNull()) {
if (response.has_value() && response.value() && !response.value()->IsNull()) {
json = std::get<std::string>(*(response.value()));
}

Expand Down