diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 462f48faf8..59c2a5a18c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1627,9 +1627,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP bool ready = false; while (!ready && count-- > 0) { - if (m_scene.TryGetClient(endPoint, out client) && client.IsActive) + if (m_scene.TryGetClient(endPoint, out client) && client.IsActive && client.SceneAgent != null) { - LLUDPClient udpClient = ((LLClientView)client).UDPClient; + LLClientView llClientView = (LLClientView)client; + LLUDPClient udpClient = llClientView.UDPClient; if (udpClient != null && udpClient.IsConnected) ready = true; else