Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Declare the js context as nullable in skwasm surface callback #45810

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/skwasm/skwasm_impl/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class SkwasmSurface {
return completer.future;
}

void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny jsContext) {
void _callbackHandler(JSNumber callbackId, JSNumber context, JSAny? jsContext) {
final Completer<JSAny> completer = _pendingCallbacks.remove(callbackId.toDartInt)!;
if (jsContext.isUndefinedOrNull) {
if (jsContext == null) {
completer.complete(context);
} else {
completer.complete(jsContext);
Expand Down