# System.NullReferenceException: Object reference not set to an instance of an object at Nakama.HttpRequestAdapter

**URL:** <https://forum.heroiclabs.com/t/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-at-nakama-httprequestadapter/345>\
**Category:** Local Setup\
**Created:** [November 29, 2019, 10:26am UTC](https://forum.heroiclabs.com/t/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-at-nakama-httprequestadapter/345 "2019-11-29T10:26:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloudAle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/cloudale/32/300_2.png) [@cloudAle](https://forum.heroiclabs.com/u/cloudAle)\
**Post date:** [November 29, 2019, 10:26am UTC](https://forum.heroiclabs.com/t/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-at-nakama-httprequestadapter/345/1 "2019-11-29T10:26:44Z")

</div>

Hello,

I’m using Unity package with nakama to query User Groups,

Documentation seems to be outdated,  
List group members from [documentation](https://heroiclabs.com/docs/social-groups-clans/#list-group-members) looks like this  
`var result = await client.ListGroupUsersAsync(session, groupId);`

While on decompiler function looks like this

```auto
    public Task<IApiGroupUserList> ListGroupUsersAsync(
      ISession session,
      string groupId,
      int? state,
      int limit,
      string cursor)

```

We’re trying to call listgroup with this

```auto
Task<IApiGroupUserList> listTask = client.ListGroupUsersAsync(session, guildId, null, guildLimit, "");
listTask.ContinueWith((task) =>
{
    bool success = !(task.IsCanceled || task.IsFaulted);
    if(success) {// do something }
    else {// do something }
}, TaskScheduler.FromCurrentSynchronizationContext());

```

But got this error

```auto
 System.NullReferenceException: Object reference not set to an instance of an object
  at Nakama.HttpRequestAdapter+<SendAsync>d__6.MoveNext () [0x0023c] in <99ab1ffd513a481fae6067e64cfa51b3>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <d7ac571ca2d04b2f981d0d886fa067cf>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <d7ac571ca2d04b2f981d0d886fa067cf>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0 
  at Nakama.ApiClient+<ListGroupUsersAsync>d__43.MoveNext () [0x001a4] in <99ab1ffd513a481fae6067e64cfa51b3>:0 

```

Other API that we’ve tested runs correctly so far, nakama is deployed to digital ocean droplets, not on local machine

Any idea on how to fix this?

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [November 30, 2019, 10:59am UTC](https://forum.heroiclabs.com/t/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-at-nakama-httprequestadapter/345/2 "2019-11-30T10:59:43Z")

</div>

Hi @cloudAle. Your method call with the user groups list feature can you try it like so:

```auto
Task<IApiGroupUserList> listTask = client.ListGroupUsersAsync(session, guildId, null, guildLimit, null);

```

We’ll update the documentation to make the usage clearer.

---

<div class="post-metadata">

**Author:** ![cloudAle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/cloudale/32/300_2.png) [@cloudAle](https://forum.heroiclabs.com/u/cloudAle)\
**Post date:** [December 1, 2019, 5:22am UTC](https://forum.heroiclabs.com/t/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-at-nakama-httprequestadapter/345/3 "2019-12-01T05:22:12Z")

</div>

Hi @novabyte, thanks for your help! I’ll mark your reply the solution
