You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: preserve explicit JSON nulls in value mappings for ListTasks without raising NullPointerExceptions #1207
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
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.
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.
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 :)
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.
Activity
Emryswu commentedon Oct 21, 2026
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.
Emryswu commentedon Oct 21, 2026
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)onJSONRPCTransport, which leaves the optionaltenantunset (null), before any HTTP request is sent:@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.
fix(grpc): avoid NPE when listTasks is called without a tenant
fix(grpc): avoid NPE when listTasks is called without a tenant (#1240)
loveen0111 commentedon Oct 30, 2026
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 :)
Emryswu commentedon Oct 31, 2026
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.kabir commentedon Nov 2, 2026
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!
kabir commentedon Nov 2, 2026
Actually, I realised I started some work last week to address some remaining issues here #1261
fix: preserve explicit nulls in data and metadata (#1261)