# FSocket = nullptr

**URL:** <https://forums.unrealengine.com/t/fsocket-nullptr/457684>\
**Category:** C++\
**Tags:** udp, sockets, unreal-engine, crash, question, CPP\
**Created:** [October 28, 2019, 4:14pm UTC](https://forums.unrealengine.com/t/fsocket-nullptr/457684 "2019-10-28T16:14:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranduil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tranduil](https://forums.unrealengine.com/u/tranduil)\
**Post date:** [October 28, 2019, 4:14pm UTC](https://forums.unrealengine.com/t/fsocket-nullptr/457684/1 "2019-10-28T16:14:13Z")

</div>

FSocket \*UdpSenderSocket = FUdpSocketBuilder(TEXT(“UpdSendSocket”))  
.AsNonBlocking()  
.AsReusable()  
.BoundToEndpoint(EndPoint)  
.BoundToPort(ThePort)  
.BoundToAddress(Addr)  
.WithBroadcast()  
.WithReceiveBufferSize(BufferSize)  
.Build() ;

```
		if (UdpSenderSocket != nullptr)
	{
		UDPReceiver = new FUdpSocketReceiver(UdpSenderSocket, ThreadWaitTime, TEXT("UDP RECEIVER"));
		UDPReceiver->OnDataReceived().BindUObject(this, &AUdpReceiver::Recv);
		UDPReceiver->Start();
	}
	else
	{ GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Empty")); }

```

This is my code but UdpSenderSocket gives nullptr and if i dont use if to check if its null engine crashes with check(Socket != nullptr); assertion failed error.
