NullPointerException when calling listGroups on number without any groups

I'm encountering an issue with signal-cli when trying to call the listGroups method for a phone number that is not a member of any groups.

Instead of receiving an empty result or a proper response, the following error is returned: {"jsonrpc":"2.0","error":{"code":-32603,"message":"null (NullPointerException)","data":null},"id":"1"}

Environment details:

  • signal-cli version: 0.13.13+morph027+1
  • Running inside Docker container
  • Triggered via REST API endpoint

Container logs: ERROR HttpServerHandler - Failed to process request. java.io.IOException: stream is closed at jdk.httpserver@21.0.2/sun.net.httpserver.Request$WriteStream.write(Request.java:379) at java.base@21.0.2/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:125) at java.base@21.0.2/java.io.BufferedOutputStream.implFlush(BufferedOutputStream.java:252) at java.base@21.0.2/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:240) at jdk.httpserver@21.0.2/sun.net.httpserver.ExchangeImpl.sendResponseHeaders(ExchangeImpl.java:281) at jdk.httpserver@21.0.2/sun.net.httpserver.HttpExchangeImpl.sendResponseHeaders(HttpExchangeImpl.java:85) at org.asamk.signal.http.HttpServerHandler.sendResponse(HttpServerHandler.java:91) at org.asamk.signal.http.HttpServerHandler.handleRpcEndpoint(HttpServerHandler.java:133) at jdk.httpserver@21.0.2/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98) at jdk.httpserver@21.0.2/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82) at jdk.httpserver@21.0.2/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:101) at jdk.httpserver@21.0.2/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:871) at jdk.httpserver@21.0.2/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98) at jdk.httpserver@21.0.2/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:847) at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base@21.0.2/java.lang.Thread.runWith(Thread.java:1596) at java.base@21.0.2/java.lang.Thread.run(Thread.java:1583) at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833) at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)

This appears to be a server-side NullPointerException, likely triggered when the account has no groups to list.

Expected behavior: If there are no groups, the API should return an empty list rather than failing with a NullPointerException.

Please advise if this is a known issue or if there’s a workaround or patch available.

Thanks in advance!