diff --git a/engine/src/flutter/shell/platform/linux/fl_basic_message_channel.cc b/engine/src/flutter/shell/platform/linux/fl_basic_message_channel.cc index be5ad98b12..ccb20ad4f6 100644 --- a/engine/src/flutter/shell/platform/linux/fl_basic_message_channel.cc +++ b/engine/src/flutter/shell/platform/linux/fl_basic_message_channel.cc @@ -182,8 +182,10 @@ G_MODULE_EXPORT void fl_basic_message_channel_set_message_handler( // Don't set handler if channel closed if (self->channel_closed) { - g_warning( - "Attempted to set message handler on closed FlBasicMessageChannel"); + if (handler != nullptr) { + g_warning( + "Attempted to set message handler on a closed FlBasicMessageChannel"); + } if (destroy_notify != nullptr) destroy_notify(user_data); return; diff --git a/engine/src/flutter/shell/platform/linux/fl_binary_messenger.cc b/engine/src/flutter/shell/platform/linux/fl_binary_messenger.cc index 50a8c21f9a..3d624a8cbe 100644 --- a/engine/src/flutter/shell/platform/linux/fl_binary_messenger.cc +++ b/engine/src/flutter/shell/platform/linux/fl_binary_messenger.cc @@ -175,9 +175,11 @@ G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel( // Don't set handlers if engine already gone if (self->engine == nullptr) { - g_warning( - "Attempted to set message handler on closed FlBinaryMessenger without " - "engine"); + if (handler != nullptr) { + g_warning( + "Attempted to set message handler on an FlBinaryMessenger without an " + "engine"); + } if (destroy_notify != nullptr) destroy_notify(user_data); return; diff --git a/engine/src/flutter/shell/platform/linux/fl_method_channel.cc b/engine/src/flutter/shell/platform/linux/fl_method_channel.cc index b2ea8dcb61..5b52173f0e 100644 --- a/engine/src/flutter/shell/platform/linux/fl_method_channel.cc +++ b/engine/src/flutter/shell/platform/linux/fl_method_channel.cc @@ -140,7 +140,10 @@ G_MODULE_EXPORT void fl_method_channel_set_method_call_handler( // Don't set handler if channel closed if (self->channel_closed) { - g_warning("Attempted to set method call handler on closed FlMethodChannel"); + if (handler != nullptr) { + g_warning( + "Attempted to set method call handler on a closed FlMethodChannel"); + } if (destroy_notify != nullptr) destroy_notify(user_data); return;