# Unity: DeleteFriendsAsync throws Error

**URL:** <https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586>\
**Category:** Local Setup\
**Tags:** getting-started\
**Created:** [March 27, 2020, 7:34pm UTC](https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586 "2020-03-27T19:34:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DamarXCV](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@DamarXCV](https://forum.heroiclabs.com/u/DamarXCV)\
**Post date:** [March 27, 2020, 7:34pm UTC](https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586/1 "2020-03-27T19:34:43Z")

</div>

Hi all,  
I’m currently setting up my game with Nakama and its such a nice experience so far, but i stumbled upon a bug in the Unity SDK i guess.

I call the function `DeleteFriendsAsync` like in the example project “JollyRogers” and i get the following error:

> `NullReferenceException: Object reference not set to an instance of an object Nakama.UnityWebRequestAdapter+<SendRequest>d__11.MoveNext () (at Assets/External/Nakama/UnityWebRequestAdapter.cs:130) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)`

I also copied the example code from the docs(with my data), which throws the same error and its also not working in the example project “JollyRogers” for me.

My Setup:  
Unity: 2018.4.16f1  
Nakama Server: 2.4.1  
Nakama SDK: 2.3.1

Should i create a git issue about it?

---

<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:** [March 28, 2020, 5:41pm UTC](https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586/2 "2020-03-28T17:41:04Z")

</div>

@DamarXCV I can’t reproduce this so far. Did you download the Unity client from the Asset Store releases or from GitHub?

---

<div class="post-metadata">

**Author:** ![DamarXCV](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@DamarXCV](https://forum.heroiclabs.com/u/DamarXCV)\
**Post date:** [March 29, 2020, 10:17am UTC](https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586/3 "2020-03-29T10:17:47Z")

</div>

I downloaded it from the asset store.  
Did you tried to reproduce it with the sample project?  
This is what i just tried again:

1. Download the project from the [repo](https://github.com/heroiclabs/unity-sampleproject)
2. Start the server under unity-sampleproject-master\ServerModules `docker-compose -f docker-compose-postgres.yml up`
3. Open the `MainScene.unity`
4. Build the project for desktop
5. Add a Sufix to the `NakamaSessionManagerSingleton`
6. Start the game in unity (user 1)
7. Start the builded app (user 2)
8. Add user 1 with user 2
9. user 1 rejects the request and throws the error

I’m on windows but its also happening on android

---

<div class="post-metadata">

**Author:** ![DamarXCV](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@DamarXCV](https://forum.heroiclabs.com/u/DamarXCV)\
**Post date:** [March 29, 2020, 10:32am UTC](https://forum.heroiclabs.com/t/unity-deletefriendsasync-throws-error/586/4 "2020-03-29T10:32:19Z")

</div>

I just replaced the Nakama SDK (v2.3.2) from the sample project with the **[nakama-unity](https://github.com/heroiclabs/nakama-unity)** repo (v2.4.0-dev) and its working.
