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

Commit feca0f5

Browse files
committed
Show warning if method response errors occur and error not handled.
1 parent b99b4a5 commit feca0f5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

shell/platform/linux/fl_method_call.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,19 @@ G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall* self,
7979
GError** error) {
8080
g_return_val_if_fail(FL_IS_METHOD_CALL(self), FALSE);
8181
g_return_val_if_fail(FL_IS_METHOD_RESPONSE(response), FALSE);
82-
return fl_method_channel_respond(self->channel, self->response_handle,
83-
response, error);
82+
83+
g_autoptr(GError) local_error = nullptr;
84+
if (!fl_method_channel_respond(self->channel, self->response_handle, response,
85+
&local_error)) {
86+
if (error == nullptr)
87+
g_warning("Failed to send response: %s", local_error->message);
88+
else
89+
g_propagate_error(error, local_error);
90+
91+
return FALSE;
92+
}
93+
94+
return TRUE;
8495
}
8596

8697
G_MODULE_EXPORT gboolean fl_method_call_respond_success(FlMethodCall* self,

0 commit comments

Comments
 (0)