Skip to content

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

Closed

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
    Contributor

    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
    Contributor

    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.

  4. loveen0111 commented on Oct 30, 2026

    @loveen0111
    Author

    3. 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](https://github.com/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.
    

    Hey @Emryswu thanks for taking a look! Yes this error is familiar to the one ive been seeing.

    I see you've raised a fix for this, correct? I am just waiting until the new release is published with this fix, to confirm from my side that this bug is resolved. Thank you :)

  5. Emryswu commented on Oct 31, 2026

    @Emryswu
    Contributor

    Yes, the fix is in #1240, merged into main on Oct 23. It isn't in 1.4.0.Final, so it should be available in a release after that. Until then, setting the tenant explicitly (e.g. "") should avoid the NPE.

  6. kabir commented on Nov 2, 2026

    @kabir
    Collaborator

    Hi, we will do a release this week.

    I think it looks like this has been fixed, so I'll close the issue. If this is wrong please reopen it. Thanks!

  7. kabir commented on Nov 2, 2026

    @kabir
    Collaborator

    Actually, I realised I started some work last week to address some remaining issues here #1261

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