From 84c69f7df906eedf8507a93b37c343fcc7baf13c Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 17 Mar 2023 10:23:24 +1300 Subject: [PATCH] Fix incorrect usage of fl_method_error_response_new in documentation example (flutter/engine#40288) --- .../public/flutter_linux/fl_method_channel.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h b/engine/src/flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h index e03254bf94..f57918d134 100644 --- a/engine/src/flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h +++ b/engine/src/flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h @@ -44,14 +44,19 @@ G_DECLARE_FINAL_TYPE(FlMethodChannel, * g_autoptr(GError) bar_error = NULL; * g_autoptr(FlValue) result = * do_bar (fl_method_call_get_args (method_call), &bar_error); - * if (result == NULL) + * if (result == NULL) { * response = * FL_METHOD_RESPONSE (fl_method_error_response_new ("bar error", - * bar_error->message)); - * else - * response = FL_METHOD_RESPONSE (fl_method_success_response_new - * (result)); } else response = FL_METHOD_RESPONSE - * (fl_method_not_implemented_response_new ()); + * bar_error->message, + * nullptr); + * } else { + * response = + * FL_METHOD_RESPONSE (fl_method_success_response_new (result)); + * } + * } else { + * response = + * FL_METHOD_RESPONSE (fl_method_not_implemented_response_new ()); + * } * * g_autoptr(GError) error = NULL; * if (!fl_method_call_respond(method_call, response, &error))