Skip to content

[Pigeon] Make java setup methods check for null arguments #57154

Description

@gaaclarke

Here is current generated code:

public static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<Object>(
                binaryMessenger,
                "dev.flutter.pigeon.VideoPlayerApi.initialize",
                new StandardMessageCodec());
        channel.setMessageHandler(
            new BasicMessageChannel.MessageHandler<Object>() {
              public void onMessage(Object message, BasicMessageChannel.Reply<Object> reply) {
                HashMap<String, HashMap> wrapped = new HashMap<String, HashMap>();
                try {
                  api.initialize();
                  wrapped.put("result", null);
                } catch (Exception exception) {
                  wrapped.put("error", wrapError(exception));
                }
                reply.reply(wrapped);
              }
            });
      }

If api is null it should just set the channel's messageHandler to null.

related issue: #56996

Activity

  1. github-actions commented on Aug 21, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  2. locked as resolved and limited conversation to collaborators on Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: pigeonrelated to pigeon messaging codegen tool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions