Skip to content
Open
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 @@ -479,7 +479,12 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
channel.setMethodCallHandler(null);
// channel is created in onAttachedToActivity, so a headless engine that never
// attaches an Activity (e.g. an FCM background isolate) reaches here with it null.
if (channel != null) {
channel.setMethodCallHandler(null);
channel = null;
}
}

}