[Bug]: preserve explicit JSON nulls in value mappings for ListTasks without raising NullPointerExceptions · Issue #1207 · a2aproject/a2a-java · GitHub
Skip to content

[Bug]: preserve explicit JSON nulls in value mappings for ListTasks without raising NullPointerExceptions #1207

Open

Description

@loveen0111

What happened?

Hello,

I am seeing this same NullPointerException raised, as described here, #1160, during a ListTasks method call.. could you please take a look?
Im using version 1.4.0.Final

Thanks

Activity

  1. added theissue type on Oct 7, 2026
  2. Emryswu commented on Oct 21, 2026

    @Emryswu

    Hi, I'd like to take this one.

    I'll first try to reproduce the NPE on the current main with a ListTasks response containing explicit JSON nulls, covering both the JSON-RPC and REST paths. If it still reproduces, I'll open a PR with a regression test, following the same approach as #1174 for GetTask.

  3. Emryswu commented on Oct 21, 2026

    @Emryswu

    I tried to reproduce this on the latest main (05f5d9b) and couldn't trigger the response-side NPE. Explicit nulls in optional fields, metadata at every level, nested objects and arrays all deserialize fine on both the JSON-RPC and REST paths. The fix from #1174 also seems to be included in 1.4.0.Final already.

    While testing, though, I did hit a separate NPE on the request side when calling listTasks(ListTasksParams.builder().build(), null) on JSONRPCTransport, which leaves the optional tenant unset (null), before any HTTP request is sent:

    java.lang.NullPointerException
        at org.a2aproject.sdk.grpc.ListTasksRequest$Builder.setTenant(ListTasksRequest.java:910)
        at org.a2aproject.sdk.grpc.mapper.ListTasksParamsMapperImpl.toProto(ListTasksParamsMapperImpl.java:44)
        at org.a2aproject.sdk.grpc.utils.ProtoUtils$ToProto.listTasksParams(ProtoUtils.java:104)
        at org.a2aproject.sdk.client.transport.jsonrpc.JSONRPCTransport.listTasks(JSONRPCTransport.java:177)
    

    @loveen0111 could you share the stack trace you're seeing? If it matches this one, I'm happy to open a PR with a regression test for it.

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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions